Skip to content

Skip image push on fork pull requests#117

Open
laritakr wants to merge 1 commit into
mainfrom
fix-fork-pr-build-push
Open

Skip image push on fork pull requests#117
laritakr wants to merge 1 commit into
mainfrom
fix-fork-pr-build-push

Conversation

@laritakr

@laritakr laritakr commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • The reusable build workflow no longer fails on pull requests opened from a fork.

Needed for: samvera-labs/hyku_knapsack#53

Details

  • Fork PRs run with a read-only GITHUB_TOKEN that cannot write organization packages. The build step pushed images unconditionally, so on a fork PR the push was denied, the build job failed, and the matrix fail-fast cancelled the remaining jobs (test and lint never ran).
  • The build step now pushes only for same-repo events; a fork PR still builds each image (validating the Dockerfile) but skips the registry push.
  • The multiarch-manifest push job is skipped under the same condition, since a fork PR produces no per-arch tags to assemble.
  • Same-repo pushes, same-repo PRs, merges to the default branch, and workflow_dispatch are unaffected — they push exactly as before.

The build workflow now pushes images only for same-repo events, so a
pull request from a fork builds each image to validate it but does not
attempt the registry push.
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