Repository navigation
ci(check): set an explicit read-only permissions floor - #33
Merged
Merged
Conversation
The workflow declared no permissions, so its GITHUB_TOKEN inherited the repository default. CodeQL flagged all three jobs (actions/missing-workflow-permissions). Every job only reads the repository — checkout, uv sync, ruff, pyright, pytest, and a git diff drift check — so contents: read at the top level covers all three. release.yml already declares its own.
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.
check.ymldeclared nopermissions:key, so itsGITHUB_TOKENinherited the repository default. CodeQL flagged all three jobs withactions/missing-workflow-permissions:check.yml:11— security/code-scanning/1check.yml:30— security/code-scanning/2check.yml:50— security/code-scanning/3These are the 3 open code-scanning alerts on the org.
Fix
permissions: contents: readat the top level. Every job only reads the repository — checkout,uv sync, ruff, pyright, pytest, and agit diffdrift check — so one top-level floor covers all three.release.ymlalready declares its own and was not flagged.Verification
just checkandjust testboth pass (120 passed, 4 skipped). YAML parses withpermissions = {'contents': 'read'}across jobscheck,test,codegen.