Add explicit GITHUB_TOKEN permissions to workflow callers - #70
Merged
Conversation
Resolves the three open `actions/missing-workflow-permissions` CodeQL alerts (#1, #3, #4). Each is a single-job caller of a reusable workflow in rubyatscale/shared-config, so the permissions block goes job-level, right above `uses:`, matching the query_packwerk precedent. A caller's block is the ceiling for the called workflow, so each grant covers exactly what the callee does and nothing more. - cd.yml -> contents: write. shared-config's cd.yml checks out with persisted credentials and runs discourse/publish-rubygems-action, which does `rake release` (a raw git push of the version tag), then `gh release create`. Anything less breaks the gem release. - stale.yml -> issues: write + pull-requests: write. shared-config's stale.yml runs actions/stale, which comments on and closes both stale issues and stale PRs. The implicit read of repo contents still works without naming contents. - triage.yml -> issues: write. shared-config's triage.yml only runs `gh issue edit --add-label triage`. ci.yml already declares workflow-level `contents: read` and codeql.yml already declares its own block, so both are left untouched.
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.
Resolves the three open
actions/missing-workflow-permissionsCodeQLalerts (#1, #3, #4). Each is a single-job caller of a reusable workflow in
rubyatscale/shared-config, so the permissions block goes job-level, right
above
uses:, matching the query_packwerk precedent. A caller's block isthe ceiling for the called workflow, so each grant covers exactly what the
callee does and nothing more.
persisted credentials and runs discourse/publish-rubygems-action, which
does
rake release(a raw git push of the version tag), thengh release create. Anything less breaks the gem release.stale.yml runs actions/stale, which comments on and closes both stale
issues and stale PRs. The implicit read of repo contents still works
without naming contents.
gh issue edit --add-label triage.ci.yml already declares workflow-level
contents: readand codeql.ymlalready declares its own block, so both are left untouched.
Alerts resolved
actions/missing-workflow-permissions(medium) —.github/workflows/cd.yml:11actions/missing-workflow-permissions(medium) —.github/workflows/stale.yml:8actions/missing-workflow-permissions(medium) —.github/workflows/triage.yml:9Verification
permissions:block (cross-checked by parsing the YAML against the alert list).actionlintoutput is byte-identical tomain— no new findings introduced.codeql.ymluntouched.