Skip to content

ci: limit the release draft token to contents and pull requests - #338

Merged
thomson-t merged 1 commit into
mainfrom
ci/scope-release-app-token
Nov 4, 2026
Merged

thomson-t merged 1 commit into
mainfrom
ci/scope-release-app-token

Conversation

@thomson-t

Copy link
Copy Markdown
Contributor

Why

The release automation creates a short-lived token from the release GitHub App to open each release pull request. That token carried every permission the App has, which is more than opening a pull request needs. After this lands, the token has only two: write access to this repository's contents and to its pull requests.

Programme

Standalone change, no programme.

What changes

Before: the token step in Release – Draft asked for no specific permissions, so the token received all of the App installation's permissions. After: it asks for contents: write and pull-requests: write only. The pull request step is the token's only user, and the release pull request changes no workflow files, so no workflows permission is needed.

No changelog entry or documentation change, because nothing in the published package or the release steps changes.

Linked work

Unblocks: the same change for maintenance/5.x, planned as its own pull request.
Related: #336 and #337, which moved the App's credentials into the release environment on main and maintenance/5.x.

Rollout

Path: CI only; nothing is published. The change takes effect on the next Release – Draft run from main.
Feature flags: none.
Turning it off: revert this pull request, which takes minutes and leaves nothing behind.
What we watch: the next Release – Draft run on main opens its release pull request. A failure at the "Generate a token" step means the App installation lacks one of the two permissions.

Risks

  • The App installation lacks one of the two permissions, so token creation fails; earlier Release – Draft runs used this token to push a branch and open a pull request, which needs both; we would see Release – Draft fail at its "Generate a token" step.

Risk class: low.

Who

Written by: an automated coding agent (Claude Code), at an engineer's request.
Code reviewed before opening: an independent review agent reviewed the commit on 4 November 2026 and found no blocking issues; no person has reviewed it yet.
Design reviewed before opening: no one.
Decision this implements: an engineer's request on 4 November 2026 to limit the release token's permissions; internal, cannot be linked.
Checked: on 4 November 2026, before opening: the repository's lint checks passed on the changed file, the workflow parses, and both input names exist in the pinned version of the token action.
Not checked: a Release – Draft run with the narrowed token, which would open a real release pull request; the next release checks it.

Size

Hand-written: 2 lines added in 1 file.
Generated: none.

🤖 Generated with Claude Code

The token Release – Draft creates carried every permission the GitHub
App's installation has. It now asks for only what opening the release
pull request needs: write access to contents and to pull requests.

The create-pull-request step is the token's only user, and the release
pull request changes no workflow files, so it needs no workflows
permission.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@thomson-t
thomson-t marked this pull request as ready for review November 4, 2026 15:18
@thomson-t
thomson-t requested a review from a team as a code owner November 4, 2026 15:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T15:19:37.182589Z 9484874 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment thread .github/workflows/release-draft.yml Resolved

@nickolas-dimitrakas nickolas-dimitrakas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Narrowing the Release – Draft token to contents:write and pull-requests:write covers push + PR creation; no workflows permission needed. Checks green. Watch the next Release – Draft run for the Generate a token step.

@thomson-t
thomson-t merged commit c70b5a4 into main Nov 4, 2026
14 checks passed
@thomson-t
thomson-t deleted the ci/scope-release-app-token branch November 4, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants