ci: set explicit GITHUB_TOKEN permissions on generate and test - #1741
Open
biglittlebigben wants to merge 1 commit into
Open
ci: set explicit GITHUB_TOKEN permissions on generate and test#1741biglittlebigben wants to merge 1 commit into
biglittlebigben wants to merge 1 commit into
Conversation
|
CodeQL flags workflows that rely on the default GITHUB_TOKEN permissions. These two predate the check, so nothing flagged them, but they carry the same exposure. release.yaml and slack-notifier.yaml already scope theirs. generate.yaml needs `contents: write` because add-and-commit pushes the regenerated output - the `contents: read` CodeQL suggests as a starting point would break it. buildtest.yaml only reads the checkout: its cache steps need no token scope, and golangci-lint-action only wants pull-requests: read for only-new-issues, which is not set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
biglittlebigben
force-pushed
the
ci/workflow-permissions
branch
from
August 25, 2026 17:01
dd4523d to
ab9c8b8
Compare
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.
Follow-up to #1733. CodeQL flagged the equivalent workflow in psrpc#124 for relying on the default
GITHUB_TOKENpermissions (actions/missing-workflow-permissions). These two workflows predate the check so nothing flagged them, but they carry the same exposure.release.yamlandslack-notifier.yamlalready scope theirs.generate.yamlcontents: writeadd-and-commitpushes the regenerated outputbuildtest.yamlcontents: readNote
generate.yamldeliberately does not take CodeQL's suggestedcontents: readstarting point — that would break the commit step.buildtest.yamlneeds nothing beyondcontents: read: the cache restore/save steps andgolangci-lint-actionrequire no additional scopes (pull-requests: readis only needed foronly-new-issues, which isn't set).After this, every workflow in the repo has an explicit block.
🤖 Generated with Claude Code