From f3a0a3fc1065da587514094046c07b0ad2f13b25 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Sat, 14 Nov 2026 22:59:15 +0100 Subject: [PATCH] ci(release): create the marketplace release tag with the App token Only the organization's release Apps may create v* tags. GitHub refuses the built-in GitHub Actions integration as a bypass actor in an organization ruleset, so the agent-plugins-only ruleset that would have let the workflow token create the tag cannot exist. Create the tag with the repository's GitHub App instead, which the organization-wide ruleset already allows. No workflow here runs on tags or releases, so the App-created release starts nothing new. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release-please.yaml | 25 ++++++++++++++++--------- docs/marketplace-releases.md | 3 ++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 64ba403..98324ad 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -23,20 +23,27 @@ jobs: release: name: Tag and publish a merged release runs-on: ubuntu-latest - # Creating the release creates the `vX.Y.Z` tag. Only GitHub Actions may create `v*` - # tags in this repository, so this step uses the workflow token, not the App token. - # `pull-requests: write` lets release-please relabel the merged release PR as - # `autorelease: tagged` and comment the release link; without it, the next run would - # find the PR still pending and try to release it again. - permissions: - contents: write # create the vX.Y.Z tag and the GitHub release - pull-requests: write # relabel and comment on the merged release PR + # Creating the release creates the `vX.Y.Z` tag. Only the organization's release Apps may + # create `v*` tags (the "Restrict release tag creation" organization ruleset), so this step + # uses the App token, not the workflow token. The token's `pull-requests: write` lets + # release-please relabel the merged release PR as `autorelease: tagged` and comment the + # release link; without it, the next run would find the PR still pending and try to release + # it again. No workflow here runs on tags or releases, so an App-created release starts nothing. + permissions: {} timeout-minutes: 10 steps: + - name: 🔑 Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + client-id: ${{ vars.APP_CLIENT_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + permission-contents: write # create the vX.Y.Z tag and the GitHub release + permission-pull-requests: write # relabel and comment on the merged release PR - name: 🏷️ Tag and publish a merged release PR uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 with: - token: ${{ github.token }} + token: ${{ steps.app-token.outputs.token }} skip-github-pull-request: true release-pr: diff --git a/docs/marketplace-releases.md b/docs/marketplace-releases.md index 678967a..f364546 100644 --- a/docs/marketplace-releases.md +++ b/docs/marketplace-releases.md @@ -17,7 +17,8 @@ Commit titles that squash merges leave on `main`. The 2. The release PR is an ordinary pull request. Review it like any other, and merge it when the release should go out. Until then it keeps collecting the changes that land on `main`. 3. Merging it tags the merge commit `vX.Y.Z` and publishes a GitHub release with the same notes. - GitHub Actions creates the tag, which is the only identity allowed to create `v*` tags here. + The repository's GitHub App creates the tag: only the organization's release Apps may create + `v*` tags. The version follows the commits merged since the last release: