Add least-privilege permissions to workflows missing them - #1074
Merged
Conversation
Six workflows declared no permissions block and fell back to the repository default GITHUB_TOKEN scope, which can be broader than the job needs. Declare an explicit block on each so the token is scoped to the work the job actually does. The base installer gets contents: write to tag and publish its Release, the commit-message check gets contents: read plus pull-requests: write for its sticky comment, and link-check, openspec-validate, check-whitespace, and stray-docs get contents: read only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
NUnit Tests 1 files 1 suites 11m 48s ⏱️ Results for commit ffc0a6c. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1074 +/- ##
=========================================
+ Coverage 0 38.07% +38.07%
=========================================
Files 0 1499 +1499
Lines 0 350146 +350146
Branches 0 40239 +40239
=========================================
+ Hits 0 133323 +133323
- Misses 0 187544 +187544
- Partials 0 29279 +29279 🚀 New features to boost your workflow:
|
papeh
approved these changes
Aug 17, 2026
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.
What
Six workflows declared no
permissions:block, so theirGITHUB_TOKENfell back to the repository/organization default scope. This adds an explicit least-privilege block to each.base-installer-cd.ymlcontents: writesoftprops/action-gh-release)CommitMessage.ymlcontents: read,pull-requests: writelink-check.ymlcontents: readopenspec-validate.ymlcontents: readcheck-whitespace.ymlcontents: readstray-docs.ymlcontents: readWhy it matters
Without an explicit block, a workflow inherits whatever the default token permissions are. If that default is read/write (the legacy default), every one of these jobs — including ones that only lint or check out code — runs with a broadly-writable token. Declaring the minimum each job needs limits the blast radius if a step or a third-party action is compromised.
CI.ymlandpatch-installer-cd.ymlalready declared explicit permissions and are left unchanged.Scope / validation
permissions:blocks, no logic changes).This is one of two PRs from a GitHub Actions security audit. The other PR (
Randomize GITHUB_ENV delimiter in commit-message check) also editsCommitMessage.ymlin a different region, so the two merge independently.This change is