Add explicit GITHUB_TOKEN permissions to workflow callers - #62
Merged
Conversation
CodeQL actions/missing-workflow-permissions flagged the three reusable-workflow caller jobs that had no effective permissions block (ci.yml already declares contents: read). Each caller job now grants the least privilege the called shared-config workflow actually needs, since a caller's permissions become the ceiling for the whole called workflow. - cd.yml -> contents: write. shared-config/cd.yml checks out with persisted credentials and runs discourse/publish-rubygems-action, whose `rake release` does a raw `git push` of the version tag, then runs `gh release create`. Anything less breaks the deploy. Its notify_on_failure job only posts to a Slack webhook and needs no scope. - stale.yml -> issues: write + pull-requests: write. actions/stale comments on and closes both stale issues and stale PRs. - triage.yml -> issues: write. shared-config/triage.yml runs `gh issue edit --add-label triage` and declares issues: write on its own job, so the caller must grant at least that.
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.
CodeQL actions/missing-workflow-permissions flagged the three
reusable-workflow caller jobs that had no effective permissions block
(ci.yml already declares contents: read). Each caller job now grants the
least privilege the called shared-config workflow actually needs, since a
caller's permissions become the ceiling for the whole called workflow.
persisted credentials and runs discourse/publish-rubygems-action, whose
rake releasedoes a rawgit pushof the version tag, then runsgh release create. Anything less breaks the deploy. Itsnotify_on_failure job only posts to a Slack webhook and needs no scope.
comments on and closes both stale issues and stale PRs.
gh issue edit --add-label triageand declares issues: write on itsown job, so the caller must grant at least that.
Alerts resolved
actions/missing-workflow-permissions(medium) —.github/workflows/stale.yml:8actions/missing-workflow-permissions(medium) —.github/workflows/cd.yml:11actions/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.