From 7f3de5fc5b068c6094faf6021411b180cc24df46 Mon Sep 17 00:00:00 2001 From: Patryk Ciechanski Date: Thu, 12 Jun 2025 12:45:27 +0200 Subject: [PATCH] fix: Enable automatic Docker workflow triggering with PAT token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace GITHUB_TOKEN with PAT in auto-version workflow to allow triggering subsequent workflows - Improve Docker workflow README update logic to handle repository_dispatch events properly - Add support for manual Docker builds with latest tag updates - Fix condition logic for when to update README.md documentation This resolves the issue where fix: prefixed PRs created tags but didn't trigger Docker builds, ensuring complete automation flow from PR merge → version bump → Docker build → README update. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/auto-version.yml | 2 +- .github/workflows/build_and_publish_docker.yml | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-version.yml b/.github/workflows/auto-version.yml index 9149f55..09ce3a4 100644 --- a/.github/workflows/auto-version.yml +++ b/.github/workflows/auto-version.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PAT }} - name: Setup Python uses: actions/setup-python@v4 diff --git a/.github/workflows/build_and_publish_docker.yml b/.github/workflows/build_and_publish_docker.yml index fa6af44..e37dcc7 100644 --- a/.github/workflows/build_and_publish_docker.yml +++ b/.github/workflows/build_and_publish_docker.yml @@ -117,17 +117,21 @@ jobs: echo "[View all versions and tags →](https://github.com/${{ github.repository }}/pkgs/container/gemini-mcp-server)" >> $GITHUB_STEP_SUMMARY - name: Update README with latest image info - if: github.ref_type == 'tag' || github.event_name == 'repository_dispatch' + if: github.ref_type == 'tag' || (github.event_name == 'repository_dispatch' && github.event.client_payload.pr_number != '') run: | # Extract the primary image tag for updating README if [[ "${{ github.ref_type }}" == "tag" ]]; then # For tag releases, use the version tag LATEST_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}" UPDATE_TYPE="release" - else + elif [[ "${{ github.event_name }}" == "repository_dispatch" && "${{ github.event.client_payload.pr_number }}" != "" ]]; then # For repository_dispatch (PR builds), use the PR tag LATEST_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.client_payload.pr_number }}" UPDATE_TYPE="development" + else + # For manual repository_dispatch without PR number, use latest tag + LATEST_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" + UPDATE_TYPE="manual" fi echo "Updating README.md with latest Docker image: $LATEST_TAG" @@ -161,12 +165,19 @@ jobs: All documentation now references the latest stable image. 🤖 Automated by GitHub Actions" - else + elif [[ "$UPDATE_TYPE" == "development" ]]; then git commit -m "docs: Update Docker image references for PR #${{ github.event.client_payload.pr_number }} Automated update after Docker image publish for development build. Documentation updated to reference the latest development image. + 🤖 Automated by GitHub Actions" + else + git commit -m "docs: Update Docker image references to latest + + Automated update after manual Docker image build. + Documentation updated to reference the latest image. + 🤖 Automated by GitHub Actions" fi