Skip to content

ci: add explicit permissions to all GitHub Actions workflows#1763

Merged
mschile merged 2 commits into
masterfrom
mschile/thirsty-margulis-f141c4
May 15, 2026
Merged

ci: add explicit permissions to all GitHub Actions workflows#1763
mschile merged 2 commits into
masterfrom
mschile/thirsty-margulis-f141c4

Conversation

@mschile
Copy link
Copy Markdown
Collaborator

@mschile mschile commented May 15, 2026

Summary

  • Adds explicit permissions blocks to all 34 workflow files
  • Workflows are now self-documenting and independent of the repository-level default GITHUB_TOKEN permission setting

Changes

Workflow(s) Permissions
main.yml Top-level contents: read; release job overrides to contents: write (needed for semantic-release and pushing version branches)
29 example-*.yml contents: read
check-dist.yml, check-markdown.yml contents: read
add-issue-to-triage-board.yml permissions: {}
triage_closed_issue_comment.yml permissions: {}

Why

Previously, none of the workflows declared a permissions block, relying on the repository default (currently "Read and write"). By making permissions explicit in each workflow:

  1. Workflows follow the principle of least privilege regardless of the repo setting
  2. The repo default can be safely switched to read-only
  3. Each workflow is self-documenting about what access it actually needs

Test plan

  • Verify all existing CI workflows pass with these changes

Note

Low Risk
Mostly declarative GitHub Actions permission scoping; the main risk is mis-scoped GITHUB_TOKEN permissions causing CI/release/triage automation failures.

Overview
Adds explicit permissions blocks across GitHub Actions workflows to enforce least-privilege GITHUB_TOKEN access.

Most CI/example workflows now request only contents: read, triage reusable-workflow triggers explicitly set permissions: {}, and main.yml scopes read-only at the workflow level while granting the release job contents/issues/pull-requests: write for publishing.

Reviewed by Cursor Bugbot for commit 7227f7f. Bugbot is set up for automated code reviews on this repo. Configure here.

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)
@mschile mschile self-assigned this May 15, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread .github/workflows/main.yml
Comment thread .github/workflows/example-recording.yml
- 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
@mschile mschile merged commit 1b6f360 into master May 15, 2026
90 checks passed
@mschile mschile deleted the mschile/thirsty-margulis-f141c4 branch May 15, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants