ci: only build release candidates when a release will actually happen - #7
Merged
Merged
Conversation
On main the sole purpose of building is to feed a release — PR CI has already verified the code. But build ran unconditionally, so every infra-only merge spent tens of minutes on four legs and pushed candidate images that nothing would ever reference. Two consecutive `ci:` merges did exactly that today, orphaning 9520c62-* and 3a4af4d-* in GHCR. Path filtering cannot fix this: a releasing commit type touching only docs would skip the build and leave publish-images with nothing to retag. The release decision, not the diff, is what matters — so a `plan` job asks semantic-release in dry-run mode first and build is guarded on its answer. The guard is `!= 'false'` rather than `== 'true'` deliberately. If the dry run's output is ever empty or unexpected, the build still runs: skipping a build a release needs breaks publishing, while an extra build only costs time. Also serialises release runs. Two overlapping runs could tag or retag over each other, and a half-finished release is worse than a slow one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the Release GitHub Actions workflow to avoid building and pushing candidate devcontainer images on main when semantic-release would not publish a release, reducing unnecessary CI runtime and GHCR churn.
Changes:
- Added workflow-level
concurrencyto serialize release runs onmain(queue instead of cancel). - Introduced a
planjob that runs semantic-release in dry-run mode and exportswill_release/versionoutputs. - Guarded the build/push steps in the matrix
buildjob based on theplandecision, and wiredreleaseto depend onplan.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
56
to
58
| build: | ||
| needs: plan | ||
| strategy: |
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.
On main the sole purpose of building is to feed a release — PR CI has already verified the code. But build ran unconditionally, so every infra-only merge spent tens of minutes on four legs and pushed candidate images that nothing would ever reference. Two consecutive
ci:merges did exactly that today, orphaning 9520c62-* and 3a4af4d-* in GHCR.Path filtering cannot fix this: a releasing commit type touching only docs would skip the build and leave publish-images with nothing to retag. The release decision, not the diff, is what matters — so a
planjob asks semantic-release in dry-run mode first and build is guarded on its answer.The guard is
!= 'false'rather than== 'true'deliberately. If the dry run's output is ever empty or unexpected, the build still runs: skipping a build a release needs breaks publishing, while an extra build only costs time.Also serialises release runs. Two overlapping runs could tag or retag over each other, and a half-finished release is worse than a slow one.