Skip to content

Auto-detect digger-os and digger-arch from runner.os / runner.arch #2608

@samuel-gamelin

Description

@samuel-gamelin

Problem

The digger-os and digger-arch inputs default to Linux and X64. The download step doesn't use GitHub's built-in runner.os / runner.arch contexts to resolve the correct binary. On non-x86 Linux or macOS self-hosted runners, this downloads the wrong binary.

Related: #2316 (same root cause on Linux ARM64)

Proposed fix

Change the input defaults to empty strings and auto-detect when not explicitly set. The release already publishes lowercase Go-convention binaries alongside the legacy Linux-X64 one:

digger-cli-linux-amd64    ✅
digger-cli-linux-arm64    ✅
digger-cli-darwin-amd64   ✅
digger-cli-darwin-arm64   ✅
digger-cli-windows-amd64  ✅

Auto-detection in the download step:

if [[ -z "$DIGGER_OS" ]]; then
  case "${{ runner.os }}" in
    Linux) DIGGER_OS="linux" ;;
    macOS) DIGGER_OS="darwin" ;;
    Windows) DIGGER_OS="windows" ;;
  esac
fi

if [[ -z "$DIGGER_ARCH" ]]; then
  case "${{ runner.arch }}" in
    X64) DIGGER_ARCH="amd64" ;;
    ARM64) DIGGER_ARCH="arm64" ;;
    ARM) DIGGER_ARCH="arm" ;;
    X86) DIGGER_ARCH="386" ;;
  esac
fi

This is backward-compatible — Linux X64 runners resolve to digger-cli-linux-amd64 which already exists. Self-hosted runners on other platforms work without manual configuration.

Current workaround

Manually set both inputs per workflow:

- uses: diggerhq/digger@v0.6.142
  with:
    digger-os: darwin
    digger-arch: arm64

Environment

  • Self-hosted macOS ARM64 (Apple Silicon), digger v0.6.142

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions