ci: declare permissions on release workflow#4495
Open
arpitjain099 wants to merge 1 commit into
Open
Conversation
The release workflow runs changesets/action which either opens a "Release PR" or publishes packages to npm using NPM_TOKEN. Both paths use the workflow's GITHUB_TOKEN: contents:write to tag and push the release commit, pull-requests:write to open and update the release PR. This brings the permissions story in line with publish-site.yml (contents:read + pull-requests:write at workflow scope) and release-snapshot.yml (per-job contents:write + id-token:write). Signed-off-by: Arpit Jain <[email protected]>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Releaseworkflow runschangesets/action@v1, which onpushtomain/spectrum-twoeither opens a "Release PR" (when there are unreleased changesets) or publishes packages to npm (when a release is being landed). Both paths use the workflow'sGITHUB_TOKEN-- the action needscontents: writeto push the release commit / tag andpull-requests: writeto open and update the release PR.This patch sets that minimum at workflow scope, matching the explicit permission blocks already declared by
build.yml(contents: read,pull-requests: write),publish-site.yml(same shape),release-snapshot.yml(per-jobcontents: write,id-token: write), and the rest of the hardened workflows here. With it set:Token-Permissionscheck passes for this filechangesets/actionor any reachable third-party action is ever compromised (cf.tj-actions/changed-filesCVE-2025-30066), the explicit scope keeps it inside the contents + pull-requests boundary rather than whatever the default grantsThe npm publish path uses
NPM_TOKEN(external secret), so the workflow token doesn't needpackages:scope for that.No behavioural change.