Skip to content

ci: add explicit permissions to all workflows#586

Open
cjroth wants to merge 3 commits intomainfrom
fix/explicit-workflow-permissions
Open

ci: add explicit permissions to all workflows#586
cjroth wants to merge 3 commits intomainfrom
fix/explicit-workflow-permissions

Conversation

@cjroth
Copy link
Copy Markdown
Member

@cjroth cjroth commented Apr 14, 2026

Summary

  • Add top-level permissions: blocks to all 10 workflows that were missing them
  • Workflows that already have job-level permissions on all jobs get permissions: {} at the top level (claude.yml, enterprise-deploy.yml, enterprise-publish.yml) — this makes the default restrictive
  • Read-only workflows get permissions: contents: read (ci.yml, e2e.yml, ios-release.yml, test-build.yml)
  • Write workflows get permissions: contents: write (create-version-tag.yml, desktop-release.yml, version-bump.yml)
  • Applies principle of least privilege — without explicit permissions, workflows inherit the repo-level default (often write-all), which is overly permissive

Test plan

  • Verify CI workflows pass (they only need contents: read + job-level overrides)
  • Verify release workflows can still create tags and releases (contents: write)
  • Verify enterprise-deploy still gets OIDC tokens (job-level id-token: write is preserved)

Note

Medium Risk
Workflow permission defaults are tightened; if any job implicitly relied on broader GITHUB_TOKEN scopes, CI/release/deploy steps could start failing. Changes are limited to GitHub Actions config (no product/runtime code).

Overview
Adds explicit top-level permissions across GitHub Actions workflows to avoid inheriting permissive repo defaults.

Most workflows now default to either permissions: {} (no token permissions unless a job opts in) or contents: read, while workflows that need to publish artifacts/tags retain job-level elevated permissions (e.g., packages: write, id-token: write).

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

Apply principle of least privilege by adding top-level permissions
blocks to all workflows that were missing them. Workflows with
job-level permissions use `permissions: {}` at the top to ensure
no default permissions leak. This prevents token privilege escalation
if a workflow is compromised.
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

cjroth has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@github-actions
Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

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 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit faa7592. Configure here.

Comment thread .github/workflows/ci.yml
cancel-in-progress: true

permissions:
contents: read
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing pull-requests permission breaks CI change detection

High Severity

The new top-level permissions: contents: read block causes the detect-changes job to lose pull-requests: read access. dorny/paths-filter@v3 requires pull-requests: read on pull_request events because it uses the GitHub REST API to fetch modified files. Without it, the action will fail, breaking the detect-changes job and the downstream rust job that depends on it for all pull requests. The typescript job is unaffected because it has its own job-level pull-requests: write override.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit faa7592. Configure here.

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

cjroth has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

PR Metrics

Metric Value
Lines changed (prod code) +12 / -0
JS bundle size (gzipped) 🟢 1.00 MB → 1023.1 KB (-5.1 KB, -0.5%)
Test coverage 🟢 70.27% → 70.27% (+0.0%)
Load time (preview) Lighthouse results unavailable

Updated Tue, 14 Apr 2026 22:54:37 GMT · run #822

@cjroth cjroth temporarily deployed to fix/explicit-workflow-permissions - thunderbolt PR #586 April 14, 2026 22:52 — with Render Destroyed
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

cjroth has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@cjroth cjroth changed the title fix(ci): add explicit permissions to all workflows chore(ci): add explicit permissions to all workflows Apr 15, 2026
@cjroth cjroth changed the title chore(ci): add explicit permissions to all workflows ci: add explicit permissions to all workflows Apr 15, 2026
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.

1 participant