Skip to content

ci: limit the release draft token to contents and pull requests (5.x) - #339

Merged
thomson-t merged 1 commit into
maintenance/5.xfrom
ci/scope-release-app-token-5.x
Nov 4, 2026
Merged

thomson-t merged 1 commit into
maintenance/5.xfrom
ci/scope-release-app-token-5.x

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 from maintenance/5.x. 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 permissions: to this repository's contents and to its pull requests.

Programme

Standalone change, no programme.

What changes

The same two lines as #338 on main. 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

Related: #338, the same change on main; #337, which moved the App's credentials into the release environment on maintenance/5.x.

Rollout

Path: CI only; nothing is published. The change takes effect on the next Release – Draft run from maintenance/5.x.
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 maintenance/5.x 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 on this branch 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, confirmed it matches the main change byte for byte, 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, 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 5.x 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:20:20.607842Z f5a456c 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.

Same two-line change as #338 for maintenance/5.x. Checks green. Watch the next 5.x Release – Draft run for the Generate a token step.

@thomson-t
thomson-t merged commit 3d01291 into maintenance/5.x Nov 4, 2026
11 checks passed
@thomson-t
thomson-t deleted the ci/scope-release-app-token-5.x 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