Skip to content

ci: grant publishing permissions to the deploy job only - #11

Merged
tannevaled merged 1 commit into
mainfrom
least-privilege-pages-permissions
Aug 30, 2026
Merged

ci: grant publishing permissions to the deploy job only#11
tannevaled merged 1 commit into
mainfrom
least-privilege-pages-permissions

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

A pull-request build runs third-party code — a dependency resolved during the build, an action at a floating tag — and it should not do so holding a token that can publish the site or write the repository.

Nothing leaked: the deploy step was already gated on the branch. This narrows the grant rather than closing a hole. Publishing rights now sit on the deploy job alone.

Part of a fleet-wide sweep of 545 workflows. Proven first on go-asmgen/go-asmgen.github.io#7 and go-asmgen/docs#11, where the pull request reported build=success deploy=skipped and main after merge reported build=success deploy=success — the narrowed grant still publishes, and a pull request still cannot.

The workflow-level permissions block applied to every job, so the build that
runs on a pull request held a token able to publish the site. Nothing leaked:
the deploy job is gated on the branch and a pull request never reaches it. But
a pull request build is exactly where third-party code runs -- a dependency
resolved during the build, an action at a floating tag -- and it should not run
holding a token it has no use for.

The publishing grant moves down to the deploy job. The workflow keeps only what
the build actually reads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit f62ec9c into main Aug 30, 2026
2 checks passed
@tannevaled
tannevaled deleted the least-privilege-pages-permissions branch August 30, 2026 20:50
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