Repository navigation
ci(workflows): set a read-only default token permission - #45
Merged
Merged
Conversation
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.
Closes the CodeQL
actions/missing-workflow-permissionsalerts #14, #15, #16, #17.ci.yml,scheduled-lint.yml,upstream-drift.ymlhad nopermissions:block, so every job without its own block ran with the default token. Each now starts with a top-levelpermissions: contents: read. The existing job-level blocks are untouched and still replace it for their own job. I went through every job that has no block of its own: they check out, install and run, and none comments, pushes, releases or calls the API. The org default token is already read-only, so the runs behave the same; the block makes it explicit per workflow.scheduled-lint.ymlalso had a real bug: the steps run underbash -e, so a failingpre-commitorpymarkdownlntended the step beforeEXIT_CODE=$?ran. The status and output were never written and the log showed nothing, because the output went to a file. The exit code is now kept with|| EXIT_CODE=$?, the captured output is printed, and$GITHUB_OUTPUTis quoted and written once (shellcheck SC2086, SC2129).upstream-drift.yml: the wheel path comes from a glob array instead ofls | head(shellcheck SC2012); the order is the same, the glob is sorted.Checked:
actionlintpasses on every changed workflow. The CodeQL run on this PR is the check that the alerts close.