ci: add least-privilege workflow permissions (CodeQL)#604
Closed
jhamon wants to merge 1 commit into
Closed
Conversation
Adds a top-level `permissions: contents: read` block to each workflow flagged by the actions/missing-workflow-permissions CodeQL rule. All four workflows are read-only (checkout, run notebooks, version census); none push to the repo, so contents: read is sufficient. Resolves 11 code-scanning alerts. Mirrors the SDK-tier fix (go-pinecone #146, pinecone-text #99, pinecone-java-client #224). Refs PIN-24. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded by #603 which covers the same changes. |
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
Adds a top-level
permissions: contents: readblock to each workflow flagged by theactions/missing-workflow-permissionsCodeQL rule.Why
CodeQL flagged 11
actions/missing-workflow-permissionsalerts across four workflows. Without an explicitpermissions:block, jobs run with the repository's defaultGITHUB_TOKENscopes, which can be broader than needed.All four workflows are read-only — they check out the repo, run notebooks, or run a version census. None push commits, tags, releases, or comments.
contents: readis sufficient.Files
client-versions.yaml(1 job)pr.yaml(3 jobs — reusable-workflow caller)test-notebooks-all.yaml(3 jobs)test-notebooks-changed.yaml(4 jobs)Verification
yaml.safe_load); each file haspermissions: {contents: read}.Resolves 11 code-scanning alerts. Mirrors the SDK-tier fix (go-pinecone #146, pinecone-text #99, pinecone-java-client #224).
Refs PIN-24.
Note
Low Risk
Workflow-only scope tightening for read-only CI; risk is low unless a step later needs broader token permissions (not indicated in these workflows).
Overview
Adds an explicit top-level
permissions: contents: readblock (with a short comment) to four GitHub Actions workflows: client version reporting, PR (caller for lint/notebooks/client-versions), test all notebooks, and test changed notebooks.This narrows the default
GITHUB_TOKENscope for those runs to repo read access only, addressing CodeQLactions/missing-workflow-permissionsalerts. Behavior is unchanged for these read-only flows (checkout, lint, notebook runs, version census); no jobs in this diff gain write, comment, or release permissions.Reviewed by Cursor Bugbot for commit d169d2d. Bugbot is set up for automated code reviews on this repo. Configure here.