From c50fa05334240f7cfb54466b6a45bf97fc642abb Mon Sep 17 00:00:00 2001 From: Patryk Ciechanski Date: Thu, 12 Jun 2025 13:14:26 +0200 Subject: [PATCH] fix: Use fetch to ensure main branch exists before checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change from 'git checkout main' to 'git fetch origin main:main' - Ensures main branch ref exists in detached HEAD state - Fixes 'pathspec main did not match' error 🤖 Generated with Claude Code --- .github/workflows/build_and_publish_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_publish_docker.yml b/.github/workflows/build_and_publish_docker.yml index 0daec5a..ffc3100 100644 --- a/.github/workflows/build_and_publish_docker.yml +++ b/.github/workflows/build_and_publish_docker.yml @@ -122,8 +122,8 @@ jobs: if: github.ref_type == 'tag' || (github.event_name == 'repository_dispatch' && github.event.client_payload.pr_number != '') run: | # Checkout main branch to avoid detached HEAD when pushing + git fetch origin main:main git checkout main - git pull origin main # Extract the primary image tag for updating README if [[ "${{ github.ref_type }}" == "tag" ]]; then # For tag releases, use the version tag