From ae93755dbb16497868d98a81d8e75f306add0888 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 4 Nov 2025 20:08:47 +0000 Subject: [PATCH] Fix GitHub Actions Docker tag generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow was generating invalid Docker tags with format ':-3b251d7' due to empty branch names in PR contexts. Problem: - Tag config: type=sha,prefix={{branch}}-,format=short - For PRs: {{branch}} is empty → results in ':-3b251d7' (invalid) - Docker doesn't allow tags starting with hyphen Solution: - Changed to: type=sha,format=short - Now generates: '3b251d7' (valid) without branch prefix - Works correctly for PRs, branches, and tags Valid tag examples now: - PRs: pr-44, 3b251d7 - Branches: main, 3b251d7 - Tags: v1.0.0, 1.0, 1, 3b251d7 --- .github/workflows/docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 994e2be..deb67d2 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -67,7 +67,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=sha,prefix={{branch}}-,format=short + type=sha,format=short type=raw,value=latest,enable={{is_default_branch}} - name: Build and push Backend Docker image @@ -147,7 +147,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=sha,prefix={{branch}}-,format=short + type=sha,format=short type=raw,value=latest,enable={{is_default_branch}} - name: Build and push Frontend Docker image