Repository navigation
ci(security): default the GITHUB_TOKEN to contents: read - #11
Merged
Merged
Conversation
Clears the open CodeQL actions/missing-workflow-permissions alert on the `test` job. publish and prerelease declare their own job-level permissions (contents/id-token/pull-requests), which replace this workflow default, so their access is unchanged; `test` only checks out, installs and builds, which read-only covers. A new job now inherits read-only instead of the repository default.
nabheet
marked this pull request as ready for review
October 31, 2026 04:26
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.
Clears the open CodeQL
actions/missing-workflow-permissionsalert on thetestjob by giving the workflow a read-only default token.Change
permissions: contents: readat workflow level.publishandprereleasekeep their own job-level blocks (contents/id-token/pull-requests), which replace the workflow default — their access is unchanged.testonly checks out, installs and builds, so read-only is sufficient.Why
The repository default token is read/write, so any job without a
permissions:block hands the workflow more authority than it needs. A workflow-level block makes read-only the default for this file and for any job added later.Verification
yqparse: workflowpermissions.contents: read; per-job permissions unchanged forpublish/prerelease.testjob, which now runs under the read-only token — that is the live check that nothing needed write.