Skip to content

ci: skip build-and-release on release-please's release PR#73

Merged
mledour merged 1 commit into
mainfrom
ci/skip-build-on-release-pr
Jun 22, 2026
Merged

ci: skip build-and-release on release-please's release PR#73
mledour merged 1 commit into
mainfrom
ci/skip-build-on-release-pr

Conversation

@mledour

@mledour mledour commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Problem

release-please force-updates its release PR (release-please--branches--main) on every push to main. That PR's pull_request event re-triggers build-and-release.yml, so every merge to main now costs two full build runs:

  • the push-to-main verification build (wanted), and
  • a redundant rebuild of the release PR (not wanted) — it only bumps version.txt + CHANGELOG.md, no code.

Observed after merging #71:
push build + redundant release-PR build.

Fix

Gate the build job:

if: ${{ !startsWith(github.head_ref, 'release-please--') }}
  • pull_request from a release-please--* branch → build skipped (no Windows runner consumed).
  • push to main / v*.*.* tag → head_ref is empty → unaffected, builds as before.
  • The real signed release build still runs on the v*.*.* tag the release PR creates when merged.

main has 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): release commit message — too fragile.

🤖 Generated with Claude Code

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>
@mledour mledour merged commit 7387e16 into main Jun 22, 2026
3 checks passed
@mledour mledour deleted the ci/skip-build-on-release-pr branch June 22, 2026 09:30
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