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