Add explicit GITHUB_TOKEN permissions to workflows - #23
Merged
Conversation
Resolves the four open `actions/missing-workflow-permissions` CodeQL alerts by giving every job an explicit, least-privilege permissions block. - ci.yml (alerts #3 `lint`, #4 `test`): both jobs only check out the repo, install node deps and run yarn lint / compile / xvfb-run yarn test. Neither touches the GitHub API, so a single workflow-level `contents: read` covers both. - stale.yml (alert #2): calls shared-config's stale.yml, which runs actions/stale to comment on and close stale issues *and* PRs, so the caller ceiling must include `issues: write` and `pull-requests: write` or the scheduled sweep silently stops closing things. - triage.yml (alert #1): calls shared-config's triage.yml, which runs `gh issue edit --add-label triage`; `issues: write` is all it needs. codeql.yml already declares its permissions and is 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 four open
actions/missing-workflow-permissionsCodeQLalerts by giving every job an explicit, least-privilege permissions
block.
lint, Scope to @gusto #4test): both jobs only check out therepo, install node deps and run yarn lint / compile / xvfb-run yarn
test. Neither touches the GitHub API, so a single workflow-level
contents: readcovers both.actions/stale to comment on and close stale issues and PRs, so the
caller ceiling must include
issues: writeandpull-requests: writeor the scheduled sweep silently stops closing things.gh issue edit --add-label triage;issues: writeis all it needs.codeql.yml already declares its permissions and is left untouched.
Alerts resolved
actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:23actions/missing-workflow-permissions(medium) —.github/workflows/ci.yml:10actions/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.