Skip to content

ci(release): grant permissions per job and pass the branch through env - #38

Merged
stephen-masters merged 1 commit into
mainfrom
ci/release-least-privilege
Nov 1, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
ci/release-least-privilege

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

The two workflow weaknesses zizmor found in every release.yml, as already fixed in the engine: permissions: {} at workflow level with contents: write on the job that pushes; the branch name through env:; permission-contents: write on the App token. zizmor reports nothing left in this file; actionlint passes. No behaviour change.

🤖 Generated with Claude Code

The three fixes zizmor asked for: contents: write only on the job that
pushes, the branch name through the environment rather than pasted into
the script, and the App token minted with permission-contents: write.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 1, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the release-workflow hardening changes.

No open issues 🎉

What changed in this PR

This PR hardens the release workflow by limiting token permissions and passing the branch name safely into the shell, without changing the intended release process.

Changes:

  • Replace workflow-wide write permissions with explicit per-job permissions.
  • Restrict the GitHub App token to repository contents write access.
  • Pass the branch name through an environment variable instead of interpolating it into the shell script.
File Description
.github/​workflows/​release.yml Scope release permissions and safely pass the branch name to git push.

Review effort: Balanced

@stephen-masters
stephen-masters merged commit 1825b24 into main Nov 1, 2026
13 checks passed
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