Skip to content

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

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>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Deploying tetrak with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8cdbd0d
Status: ✅  Deploy successful!
Preview URL: https://eb7ea401.tetrak.pages.dev
Branch Preview URL: https://ci-release-least-privilege.tetrak.pages.dev

View logs

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

No active review issues are reported for the release workflow’s permission scoping and shell input hardening changes.

No open issues 🎉

What changed in this PR

This PR hardens the release workflow’s token permissions and shell input handling while preserving the existing release process.

Changes:

  • Removes workflow-wide permissions and grants repository access per job.
  • Explicitly limits the release App token to contents: write.
  • Passes branch, version, and SBOM matrix values through environment variables instead of inserting expressions into shell scripts.
File Description
.github/​workflows/​release.yml Scopes token permissions and hardens shell input handling for release and SBOM jobs.

Review effort: Balanced

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