ci: add least-privilege workflow permissions (CodeQL)#603
Open
jhamon wants to merge 1 commit into
Open
Conversation
Resolves all 11 CodeQL actions/missing-workflow-permissions alerts. All four workflows are read-only; each only checks out the repo and runs notebooks or scripts with no GITHUB_TOKEN writes. Set contents: read. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Resolves all 11 open CodeQL
actions/missing-workflow-permissionsalerts across four workflow files. All workflows only check out the repo and run notebooks/scripts — none make writes viaGITHUB_TOKEN.Changes
permissions: contents: readpermissions: contents: readpermissions: contents: readpermissions: contents: readVerification
ruby -ryaml).Part of PIN-16 (security tail), child of PIN-6.
🤖 Generated with Claude Code
Note
Low Risk
CI-only permission tightening with no application or secret-handling changes; notebook runs still use API keys from secrets, not expanded token rights.
Overview
Adds explicit
permissions: contents: readto four GitHub Actions workflows that previously relied on the defaultGITHUB_TOKENscope, addressing CodeQLactions/missing-workflow-permissionsfindings.Affected workflows:
client-versions.yaml,pr.yaml,test-notebooks-all.yaml, andtest-notebooks-changed.yaml. Each file also documents that jobs only read the checkout and do not write viaGITHUB_TOKEN.No job logic or triggers change—only token scope is narrowed to match actual usage (checkout, validation, notebook runs using repo secrets).
Reviewed by Cursor Bugbot for commit b59fda8. Bugbot is set up for automated code reviews on this repo. Configure here.