Skip Docker image builds on forks without their own registry - #20
Merged
Conversation
The Docker image workflow publishes to ghcr.io/block/buzz unless the repo variable GHCR_IMAGE names another registry. On a fork that has not set it, every push to main and every same-repo pull request fails: the build tries to push to Block's registry, or to its build cache, and is denied. build, push-gateway-build and qualify now run only upstream, or on a fork that has set GHCR_IMAGE. The merge jobs need the builds, so they skip with them. Upstream behaviour is unchanged, and a fork that wants its own images opts in by setting the variable the workflow already reads. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
On this fork the Docker image workflow fails on every push to
mainand on every same-repo pull request: it builds relay images and tries to push them, or its build cache, toghcr.io/block/buzz, which a fork cannot write to (denied: permission_denied).Change
build,push-gateway-buildandqualifynow run only whengithub.repository == 'block/buzz' || vars.GHCR_IMAGE != ''. The two merge jobs depend on the builds, so they skip with them.GHCR_IMAGE, the variable the workflow already reads, and it runs.Three lines plus a comment, so future upstream merges stay easy. Written as a PR because this session isn't permitted to change repository settings, so disabling the workflow wasn't available.
🤖 Generated with Claude Code