Skip to content

ci: fix invalid Docker debug tag on PR builds - #4

Merged
Summpot merged 1 commit into
mainfrom
fix-docker-debug-tag
Aug 6, 2026
Merged

ci: fix invalid Docker debug tag on PR builds#4
Summpot merged 1 commit into
mainfrom
fix-docker-debug-tag

Conversation

@Summpot

@Summpot Summpot commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Why

PR-triggered Build workflow runs fail in the "Build Docker Image (linux/amd64)" and "(linux/arm64)" jobs. The failure is not related to any code change: it is a CI bug in .github/workflows/build.yml.

The Docker metadata uses type=sha,prefix={{branch}}- for the debug image tag. On pull_request events, docker/metadata-action resolves {{branch}} to an empty string, so the generated tag becomes:

ghcr.io/summpot/beaconauth:-0d4169b-debug-amd64

Docker rejects tags that start with - (invalid reference format), so docker/build-push-action fails. On main-push builds the branch context is main, so the tag is valid (main-<sha>-debug-amd64) and those runs pass. This is why every PR build fails while every main build succeeds.

Approach

Replace the branch-dependent prefix {{branch}}- with a fixed sha- prefix in both the amd64 and arm64 metadata type=sha tags:

type=sha,prefix=sha-,suffix=-debug-amd64   # before: prefix={{branch}}-
type=sha,prefix=sha-,suffix=-debug-arm64   # before: prefix={{branch}}-

This always yields a valid, unique tag (sha-<sha>-debug-amd64) regardless of event type. The branch-scoped and PR-scoped debug tags (type=ref,event=branch / type=ref,event=pr) are unchanged, so the multi-arch manifest job and release flow are unaffected.

Verification

  • The only changed lines are the two type=sha tag definitions; tag strings are now event-independent and structurally valid.
  • Manifest/release behavior is untouched: the manifest job and release workflow reference the type=ref and type=raw tags, not the type=sha tag.

The metadata tag 'type=sha,prefix={{branch}}-...' resolves to an empty
branch for pull_request events, producing an invalid Docker tag like
'-0d4169b-debug-amd64' which fails docker/build-push-action. Use a fixed
'sha-' prefix so the tag is always valid and unique across events. The
branch-scoped and PR-scoped debug tags from 'type=ref' are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Summpot
Summpot merged commit 8b444aa into main Aug 6, 2026
11 checks passed
@Summpot
Summpot deleted the fix-docker-debug-tag branch August 6, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant