Skip to content

ci: scope workflow write permissions to jobs - #739

Merged
av1155 merged 1 commit into
mainfrom
ci/scope-workflow-token-permissions
Aug 12, 2026
Merged

ci: scope workflow write permissions to jobs#739
av1155 merged 1 commit into
mainfrom
ci/scope-workflow-token-permissions

Conversation

@av1155

@av1155 av1155 commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

Moves top-level workflow write permissions down to the single job that needs them, so a step added later cannot silently inherit write access.

Closes #735

Changes

  • release.yml, star-history.yml, api-snapshot-refresh.yml, cleanup-actions-cache.yml, ci-skip.yml: default to contents: read, grant the write on the one job that uses it.

Each of these has exactly one job, and job-level permissions replace rather than merge, so every job keeps precisely the grants it had before. Only the blast radius changes.

Left alone deliberately: issues: write in the AI triage/moderation and stale workflows, and pages/id-token in pages.yml. Those are already single-job and carry no equivalent risk.

Testing

actionlint clean across all workflows (the one finding is a pre-existing SC2034 in browser-e2e.yml, untouched here). Job names are unchanged, so the 11 required checks still match branch protection.

Type of Change

  • CI/CD (ci:)

Checklist

  • Issue exists and is linked above with Closes #N
  • Linked issue has exactly one type:* and one priority:* label
  • Linked issue has at most one phase:* label (or none when not roadmap work)
  • Branch name matches issue scope
  • Tests added/updated for all changes — N/A, no application code
  • No secrets or sensitive data committed
  • Scope check: infrastructure hardening only, no behaviour change

Top-level contents/packages/actions write grants apply the token to
every job in the workflow. Move each write down to the single job
that needs it and default the workflow to contents: read.

Job-level permissions replace rather than merge, so each job keeps
exactly the grants it had before; only the blast radius changes.
@av1155
av1155 merged commit a6fdefd into main Aug 12, 2026
22 checks passed
@av1155
av1155 deleted the ci/scope-workflow-token-permissions branch August 12, 2026 00:49
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.

ci: scope workflow write permissions to jobs

1 participant