fix(go-binary-release): grant packages: write so GHCR pushes can succeed - #1
Merged
Merged
Conversation
The job declared `permissions: contents: write` and nothing else. Once any
permissions block exists everything unlisted is `none`, so GITHUB_TOKEN had
`packages: none` -- while the `docker: true` path logs into the registry as
exactly that token and then pushes.
Callers could not work around it. A reusable workflow's own block is the
authoritative one for its jobs, so a caller declaring `packages: write` on the
calling job changed nothing, and GORELEASER_TOKEN never reaches the login step,
which hardcodes secrets.GITHUB_TOKEN.
The result was a release that built for six minutes and then failed with
denied: installation not allowed to Write organization package
which reads like a registry ACL problem and is not one -- the token has no
packages scope to exercise, so granting the repository write access on the
package does not change the outcome.
Harmless when `docker` is false: nothing authenticates to a registry on that
path, so the scope goes unused.
Found releasing xraph/forge, which is pinned to @v1 and needs that tag moved to
pick this up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The failure
Releasing
xraph/forgebuilt for six minutes, produced the images, and then died on the push:Why
The
goreleaserjob declared:Once a
permissions:block exists, everything unlisted isnone— soGITHUB_TOKENhadpackages: none. Meanwhile thedocker: truepath logs into the registry as exactly that token (docker/login-actionwithpassword: ${{ secrets.GITHUB_TOKEN }}) and then pushes.The message is misleading:
installation not allowed to Write organization packagereads like a registry ACL problem. It isn't — the token has no packages scope to exercise. Granting the calling repository write access on the GHCR package does not change the outcome.Callers could not work around it:
permissions:block is authoritative for its jobs, so a caller declaringpackages: writeon the calling job changes nothing.GORELEASER_TOKENnever reaches the login step, which hardcodessecrets.GITHUB_TOKEN.The change
Adds
packages: writeto that job. Harmless whendockeris false — nothing authenticates to a registry on that path, so the scope goes unused.Note for merging
xraph/forgepins this workflow at@v1, so thev1tag has to move before it picks the fix up. Until thenforgeskips the docker pipe viagoreleaser-args: release --clean --skip=docker, which is marked temporary and references this PR.🤖 Generated with Claude Code