ci: declare workflow-scope permissions on pr, pr-prod-build, add-to-project#5153
Merged
traefiker merged 1 commit intoJun 5, 2026
Conversation
mdeliatf
approved these changes
Jun 4, 2026
mdeliatf
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for the contribution!
Contributor
|
Hi @arpitjain099 thanks again for this! It's got a conflict now; master merged Mind rebasing onto the latest |
Contributor
Author
@mdeliatf let me check |
Add an explicit top-level permissions: contents: read block to the pr and pr-prod-build workflows so the GITHUB_TOKEN is least-privilege by default instead of inheriting the repository-wide read/write default. This follows the GitHub-hardening guidance also captured by OpenSSF Scorecard's Token-Permissions check. Rebased onto latest master: dropped the add-to-project.yaml change since that workflow was removed upstream in 5b76a50. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
9a8d7e2 to
6c4aeca
Compare
|
🎉 This PR is included in version 12.3.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Three workflows currently leave the workflow
GITHUB_TOKENscope implicit. This patch pins each to its minimum:.github/workflows/add-to-project.yaml--permissions: {}(empty/deny-all). The job only runsactions/add-to-projectwith theTRAEFIKINFRA_ADD2PROJECTPAT; the implicit workflow token is unused..github/workflows/pr.yaml--permissions: contents: read. Lint + test + build via yarn. No GitHub API write..github/workflows/pr-prod-build.yaml--permissions: contents: read. Same shape as pr.yaml but for the production build path.Both build workflows invoke SHA-pinned third-party actions (
actions/checkout,actions/setup-node) and downloadsafe-chainfrom a release with hash verification. Pinning the workflow scope to read narrows the blast radius if any of those upstreams is compromised (cf. tj-actions/changed-files CVE-2025-30066).Style matches the existing workflow-level
permissions:blocks inmain.yaml(Pages deploy),pr_title.yaml(pull-requests: read), andrelease.yaml(publish).renovate.yamlis deliberately out of scope: it usesdawidd6/action-download-artifact@v20to restore an artifact across runs andactions/upload-artifact@v7to publish a fresh one. The cache plumbing there deserves a more careful permissions story than a drive-by.