Skip to content

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

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:35

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

There are no active review issues for the release workflow’s permission and shell-handling changes.

No open issues 🎉

What changed in this PR

Hardens the release workflow’s permissions and shell handling while preserving the existing release process.

Changes:

  • Moves contents: write from workflow-wide permissions to the release job.
  • Explicitly limits the GitHub App token to contents: write.
  • Passes the branch name through an environment variable instead of interpolating it directly into the shell script.
File Description
.github/​workflows/​release.yml Narrows permission grants and safely passes the branch name to git push.

Review effort: Balanced

@stephen-masters
stephen-masters merged commit 7e35845 into main Nov 1, 2026
6 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