ci: skip build-and-release on release-please's release PR#73
Merged
Conversation
release-please force-updates its release PR (release-please--branches--main) on every push to main, and that PR's pull_request event re-triggers build-and-release.yml. Result: every merge to main produced TWO build runs — the push-to-main build plus a redundant rebuild of the release PR, which only bumps version.txt + CHANGELOG.md (no code). Gate the build job with `if: !startsWith(github.head_ref, 'release-please--')` so release-please PRs no longer build. push and tag events have an empty head_ref and are unaffected; the signed release build still runs on the v*.*.* tag. main has no branch protection, so skipping leaves no required check pending on the release PR. Co-Authored-By: Claude Opus 4.8 <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.
Problem
release-please force-updates its release PR (
release-please--branches--main) on every push tomain. That PR'spull_requestevent re-triggersbuild-and-release.yml, so every merge to main now costs two full build runs:version.txt+CHANGELOG.md, no code.Observed after merging #71:
push build + redundant release-PR build.
Fix
Gate the
buildjob:pull_requestfrom arelease-please--*branch → build skipped (no Windows runner consumed).pushtomain/v*.*.*tag →head_refis empty → unaffected, builds as before.v*.*.*tag the release PR creates when merged.mainhas no branch protection (private repo, free plan), so the skipped check leaves nothing pending on the release PR.Not changed (intentional)
Merging the release PR still triggers a push-to-main build and the tag build. The push build is mildly redundant with the tag build, but it upholds the workflow's existing "every main commit is green" guarantee and happens only once per release, so it's left as-is. Detecting it would require matching the
chore(main): releasecommit message — too fragile.🤖 Generated with Claude Code