Skip to content

Commit a888140

Browse files
devantlerclaude
andauthored
ci(release): create the marketplace release tag with the App token (#711)
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 <noreply@anthropic.com>
1 parent 1995242 commit a888140

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

‎.github/workflows/release-please.yaml‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,27 @@ jobs:
2323
release:
2424
name: Tag and publish a merged release
2525
runs-on: ubuntu-latest
26-
# Creating the release creates the `vX.Y.Z` tag. Only GitHub Actions may create `v*`
27-
# tags in this repository, so this step uses the workflow token, not the App token.
28-
# `pull-requests: write` lets release-please relabel the merged release PR as
29-
# `autorelease: tagged` and comment the release link; without it, the next run would
30-
# find the PR still pending and try to release it again.
31-
permissions:
32-
contents: write # create the vX.Y.Z tag and the GitHub release
33-
pull-requests: write # relabel and comment on the merged release PR
26+
# Creating the release creates the `vX.Y.Z` tag. Only the organization's release Apps may
27+
# create `v*` tags (the "Restrict release tag creation" organization ruleset), so this step
28+
# uses the App token, not the workflow token. The token's `pull-requests: write` lets
29+
# release-please relabel the merged release PR as `autorelease: tagged` and comment the
30+
# release link; without it, the next run would find the PR still pending and try to release
31+
# it again. No workflow here runs on tags or releases, so an App-created release starts nothing.
32+
permissions: {}
3433
timeout-minutes: 10
3534
steps:
35+
- name: 🔑 Generate GitHub App token
36+
id: app-token
37+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
38+
with:
39+
client-id: ${{ vars.APP_CLIENT_ID }}
40+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
41+
permission-contents: write # create the vX.Y.Z tag and the GitHub release
42+
permission-pull-requests: write # relabel and comment on the merged release PR
3643
- name: 🏷️ Tag and publish a merged release PR
3744
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
3845
with:
39-
token: ${{ github.token }}
46+
token: ${{ steps.app-token.outputs.token }}
4047
skip-github-pull-request: true
4148

4249
release-pr:

‎docs/marketplace-releases.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Commit titles that squash merges leave on `main`. The
1616
2. The release PR is an ordinary pull request. Review it like any other, and merge it when the
1717
release should go out. Until then it keeps collecting the changes that land on `main`.
1818
3. Merging it tags the merge commit `vX.Y.Z` and publishes a GitHub release with the same notes.
19-
GitHub Actions creates the tag, which is the only identity allowed to create `v*` tags here.
19+
The repository's GitHub App creates the tag: only the organization's release Apps may create
20+
`v*` tags.
2021

2122
The version follows the commits merged since the last release:
2223

0 commit comments

Comments
 (0)