From 870faa0843d6afa1187d724570bb6c236ffed206 Mon Sep 17 00:00:00 2001 From: tinkle-community Date: Wed, 10 Dec 2025 15:10:18 +0800 Subject: [PATCH] fix: only main branch should create latest docker tag --- .github/workflows/docker-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 8c5403d1..eecdde65 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -163,11 +163,12 @@ jobs: "${GHCR_IMAGE}:${REF_NAME}-amd64" \ "${GHCR_IMAGE}:${REF_NAME}-arm64" - if [[ "${{ github.ref }}" == "refs/heads/main" ]] || [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then + # Only main branch gets the 'latest' tag (not dev) + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then docker buildx imagetools create -t "${GHCR_IMAGE}:latest" \ "${GHCR_IMAGE}:${REF_NAME}-amd64" \ "${GHCR_IMAGE}:${REF_NAME}-arm64" - echo "✅ Created latest tag" + echo "✅ Created latest tag (main branch only)" fi if [[ -n "${{ secrets.DOCKERHUB_USERNAME }}" ]]; then