From 8350732ed9dbc85563626d56a6336b5bd8905d85 Mon Sep 17 00:00:00 2001 From: Patryk Ciechanski Date: Thu, 12 Jun 2025 13:07:30 +0200 Subject: [PATCH] fix: Checkout main branch before updating README to avoid tag issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Switch to main branch before updating README - Pull latest main to ensure we have current version - Push to main branch normally - Ensures README updates are in main, not stuck on old tag 🤖 Generated with Claude Code --- .github/workflows/build_and_publish_docker.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_publish_docker.yml b/.github/workflows/build_and_publish_docker.yml index 59c9505..0daec5a 100644 --- a/.github/workflows/build_and_publish_docker.yml +++ b/.github/workflows/build_and_publish_docker.yml @@ -121,6 +121,9 @@ jobs: - name: Update README with latest image info 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 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 @@ -183,8 +186,8 @@ jobs: 🤖 Automated by GitHub Actions" fi - # Push changes back to the repository (handle detached HEAD state) - git push origin HEAD:main + # Push changes back to the repository + git push echo "### 📝 Documentation Updated" >> $GITHUB_STEP_SUMMARY echo "README.md and user guides have been automatically updated with the new Docker image tag: \`$LATEST_TAG\`" >> $GITHUB_STEP_SUMMARY