Repository navigation
ci: skip registry login and push on pull_request in build-and-release - #20
Merged
Merged
Conversation
The Build and Release workflow runs on every PR (no paths filter) and its build-base job logged into GHCR and Public ECR unconditionally, so Dependabot PRs failed with 'Password required' before any build ran. Guard all login/credential steps in both the build-base and build jobs with 'if: github.event_name != pull_request', and make build-base push only on branch pushes (cacheonly on PRs). The build job already builds --load without pushing on PRs. Mirrors the fix applied to build-base.yml and build-installers.yml in #18.
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.
Summary
Follow-up to #18. That PR fixed
build-base.ymlandbuild-installers.yml, but the workflow actually failing on the Dependabot PRs (#17, #19) isbuild-and-release.yml— it runs on every PR (nopathsfilter), and itsbuild-basejob logged into GHCR / Public ECR unconditionally:Dependabot
pull_requestruns can't read repo secrets (GHCR_PAT,AWS_*), so the login failed before any build ran.Changes
build-baseandbuildjobs withif: github.event_name != 'pull_request'(GHCR login,configure-aws-credentials, Public ECR login — six steps total).build-base'sdocker buildx buildpush only on branch pushes (--push); on PRs it builds--output=type=cacheonlywith a dummygithub_tokenso the--secretmount still resolves.buildjob already builds--load(no push) on PRs — unchanged.Net effect: PRs validate the build without needing secrets or pushing; pushes to
main/developlog in and publish as before.Testing
build-and-release.ymlvalidated as parseable YAML locally; all six login steps confirmed guarded.Build and Releasecheck exercises the fix — the login steps should now be skipped and the build run--loadonly.