Skip to content

ci: skip registry login and push on pull_request in build-and-release - #20

Merged
skunxicat merged 1 commit into
mainfrom
fix/build-and-release-skip-push-on-pr
Oct 24, 2026
Merged

skunxicat merged 1 commit into
mainfrom
fix/build-and-release-skip-push-on-pr

Conversation

@skunxicat

Copy link
Copy Markdown
Member

Summary

Follow-up to #18. That PR fixed build-base.yml and build-installers.yml, but the workflow actually failing on the Dependabot PRs (#17, #19) is build-and-release.yml — it runs on every PR (no paths filter), and its build-base job logged into GHCR / Public ECR unconditionally:

build-base > Login to GitHub Container Registry
##[error]Password required

Dependabot pull_request runs can't read repo secrets (GHCR_PAT, AWS_*), so the login failed before any build ran.

Changes

  • Guard all login/credential steps in both the build-base and build jobs with if: github.event_name != 'pull_request' (GHCR login, configure-aws-credentials, Public ECR login — six steps total).
  • Make build-base's docker buildx build push only on branch pushes (--push); on PRs it builds --output=type=cacheonly with a dummy github_token so the --secret mount still resolves.
  • The build job already builds --load (no push) on PRs — unchanged.

Net effect: PRs validate the build without needing secrets or pushing; pushes to main/develop log in and publish as before.

Testing

  • build-and-release.yml validated as parseable YAML locally; all six login steps confirmed guarded.
  • This PR's own Build and Release check exercises the fix — the login steps should now be skipped and the build run --load only.

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.
@skunxicat
skunxicat merged commit 9c7f3b6 into main Oct 24, 2026
2 checks passed
@skunxicat
skunxicat deleted the fix/build-and-release-skip-push-on-pr branch October 24, 2026 11:17
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