ci: add explicit permissions to all GitHub Actions workflows#1763
Merged
Conversation
Add explicit `permissions` blocks to all 34 workflow files so they are
self-documenting and independent of the repository-level default
GITHUB_TOKEN permission setting. This allows the repo default to be
safely changed to read-only without breaking any workflows.
- main.yml: top-level `contents: read`, release job `contents: write`
- example-*.yml, check-*.yml: `contents: read`
- triage workflows: `permissions: {}` (use PATs, not GITHUB_TOKEN)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b10a2b1. Configure here.
- release job: add issues: write and pull-requests: write for semantic-release's @semantic-release/github plugin, which comments on issues and PRs associated with releases - example-recording and example-custom-ci-build-id: add actions: read for getCiBuildId() which calls the Actions API to derive build IDs
cacieprins
approved these changes
May 15, 2026
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.

Summary
permissionsblocks to all 34 workflow filesChanges
main.ymlcontents: read; release job overrides tocontents: write(needed for semantic-release and pushing version branches)example-*.ymlcontents: readcheck-dist.yml,check-markdown.ymlcontents: readadd-issue-to-triage-board.ymlpermissions: {}triage_closed_issue_comment.ymlpermissions: {}Why
Previously, none of the workflows declared a
permissionsblock, relying on the repository default (currently "Read and write"). By making permissions explicit in each workflow:Test plan
Note
Low Risk
Mostly declarative GitHub Actions permission scoping; the main risk is mis-scoped
GITHUB_TOKENpermissions causing CI/release/triage automation failures.Overview
Adds explicit
permissionsblocks across GitHub Actions workflows to enforce least-privilegeGITHUB_TOKENaccess.Most CI/example workflows now request only
contents: read, triage reusable-workflow triggers explicitly setpermissions: {}, andmain.ymlscopes read-only at the workflow level while granting thereleasejobcontents/issues/pull-requests: writefor publishing.Reviewed by Cursor Bugbot for commit 7227f7f. Bugbot is set up for automated code reviews on this repo. Configure here.