Repository navigation
ci: scope release credentials to release environments (5.x) - #337
Conversation
Backport of #336 to maintenance/5.x. Release – Draft now runs in the `release` environment. Once the release GitHub App credentials are stored only as that environment's secrets, they reach only runs on the branches the environment allows. Maintenance – Trunk Upgrade no longer mints an app token. Actions drops a job output that contains a secret, so the token never reached the reusable workflow, which has been running on github.token. Removing the job keeps that behaviour: the pull requests it opens still do not start CI on their own, as before. RELEASING.md now says to add each maintenance branch to the npm-publish and release environments by its exact name, not by a pattern. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. It changes where release credentials come from and depends on environment settings that only an admin can configure, so a human look from the code owners is still worthwhile.
What was reviewed:
- release-draft.yml:
environment: releaseis on the only job that reads the App secrets, and the in-workflow branch check is unchanged, so it still blocks major bumps off maintenance branches. - maintenance-trunk-upgrade.yml: removing the token job should not change behaviour. Actions drops job outputs that hold masked secrets, so the reusable workflow was already getting an empty
token. I couldn't see that reusable workflow's default from here. - RELEASING.md: the exact-name guidance matches the new
releaseenvironment, and the text has no internal names or links.
Extended reasoning...
The change touches two CI workflows and RELEASING.md on the maintenance branch: 1 line is added to release-draft.yml, a 15-line token-minting job is removed from the trunk-upgrade workflow, and one doc step is rewritten. The security-sensitive surface is release credentials and publishing permissions, which move from repository-level secrets to an environment restricted by deployment branch. Whether it is correct depends on repository environment settings that the diff can't show. CODEOWNERS assigns .github/workflows/ and RELEASING.md to the SDK engineering team, which is why this defers to a human.
jaissica12
left a comment
There was a problem hiding this comment.
PR REVIEW: #337 ci: scope release credentials to release environments (5.x)
Head: eb818ed
Verdict: Approve
Risk: low. CI and docs only. Release – Draft on maintenance/5.x fails until this merges.
Scope: the same three files as #336, on maintenance/5.x.
What it does: Applies #336 to maintenance/5.x.
Findings:
None blocking or non-blocking.
Checked:
- Head
eb818ed7: the added and removed lines are identical to #336's (diffed line by line), and the three files were identical on both branches before the change. maintenance/5.x's workflows read the release secrets only in these two files, and Release – Publish usesenvironment: npm-publish.- The environment setup is the same as checked on #336.
- CI on this head passes.
Not verified:
- A successful Release – Draft run from
maintenance/5.xin the new environment.
Why
Release automation should hold its release powers only on the branches we release from. This brings the version 5 maintenance line in line with #336, so that the credentials that open its release pull requests come from the same restricted place as on the main branch. The repository-wide copies have been removed, so drafting on this line needs this change.
Programme
Standalone change, no programme.
What changes
The same change as #336, applied to
maintenance/5.x. The three files were identical on both branches before it.releaseenvironment. Its GitHub App credentials come from that environment's secrets, and the environment allows onlymainandmaintenance/5.x. The branch check inside the workflow stays as a second line.main: a maintenance branch is added to thenpm-publishandreleaseenvironments by its exact name.No changelog entry, because nothing in the published package changes.
Linked work
Depends on: nothing still open; the repository settings it relies on were applied on 2 November 2026.
Related: #336, the same change on
main, which should merge first.Rollout
Path: CI only; nothing is published. On 2 November 2026 the
releaseenvironment was set up to allow onlymainandmaintenance/5.x, with the release credentials as its secrets, and the repository-level copies were removed. Until this pull request merges, Release – Draft onmaintenance/5.xcannot get its credentials and fails at its token step.Feature flags: none.
Turning it off: revert this pull request, which takes minutes. Because the repository-level secrets are gone, they must be added again first, or Release – Draft on this branch fails at its token step.
What we watch: the next Release – Draft run on
maintenance/5.xopens its release pull request. A failure at the "Generate a token" step means the environment's secrets are wrong or missing.Risks
maintenance/5.xfails until this merges, because the repository-level secrets are already removed; merging this closes it; we would see Release – Draft fail at its token step on this branch.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 2 November 2026 and found no blocking issues; no person has reviewed it yet.
Design reviewed before opening: no one; the design is the one in #336.
Decision this implements: an engineer's request on 2 November 2026 to apply #336 to the maintenance branch as well; internal, cannot be linked.
Checked: on 2 November 2026: the three files were compared between
mainandmaintenance/5.xbefore the change and were identical, so the change applied without edits. After the settings were applied, thereleaseenvironment's deployment branches (main,maintenance/5.x) and secret names were read through the GitHub API, and a run from a branch it does not allow was refused before its first step (see #336).Not checked: a successful Release – Draft run from this branch in the new environment, which would open a real release pull request; the next 5.x release checks it.
Size
Hand-written: 4 lines added and 20 removed across 3 files, the same diff as #336.
Generated: none.
🤖 Generated with Claude Code