fix: Use fetch to ensure main branch exists before checkout

- 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
This commit is contained in:
Patryk Ciechanski
2025-06-12 13:14:26 +02:00
parent 3ccf61f145
commit c50fa05334

View File

@@ -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