From f8f2669890afb6a7aa4fcb0c13fd2cf8985fea50 Mon Sep 17 00:00:00 2001 From: Summpot Date: Thu, 6 Aug 2026 17:37:48 +0800 Subject: [PATCH] ci: fix invalid Docker debug tag on PR builds 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> --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ca2084..f70c806 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -163,7 +163,7 @@ jobs: tags: | type=ref,event=branch,suffix=-debug-amd64 type=ref,event=pr,suffix=-debug-amd64 - type=sha,prefix={{branch}}-,suffix=-debug-amd64 + type=sha,prefix=sha-,suffix=-debug-amd64 type=raw,value=latest-debug-amd64,enable={{is_default_branch}} - name: Build and push Docker image (linux/amd64) @@ -221,7 +221,7 @@ jobs: tags: | type=ref,event=branch,suffix=-debug-arm64 type=ref,event=pr,suffix=-debug-arm64 - type=sha,prefix={{branch}}-,suffix=-debug-arm64 + type=sha,prefix=sha-,suffix=-debug-arm64 type=raw,value=latest-debug-arm64,enable={{is_default_branch}} - name: Build and push Docker image (linux/arm64)