Detect release-please merge commit to fire release job#57
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
=======================================
Coverage 83.35% 83.35%
=======================================
Files 79 79
Lines 10397 10397
=======================================
Hits 8666 8666
Misses 1396 1396
Partials 335 335
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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
Fixes the gate that prevented v0.8.2 from auto-publishing when PR #56 (the release-please release PR) was merged.
Why
We run `release-please-action` with `skip-github-release: true` so the release job can do the staged tag dance — push `melange/vX.Y.Z` first, bump root `go.mod`, then tag root at the bumped commit. This guarantees `vX.Y.Z` lives on a commit whose `go.mod` is internally consistent with `VERSION`.
But `release-please-action` has a hardcoded safety check: if it finds a merged release PR with no corresponding tag, it aborts with `There are untagged, merged release PRs outstanding` — and crucially, it does not set `release_created: true`. The release job's gate (`needs.release-please.outputs.release_created == 'true'`) never fires.
The dry-run never caught this because the dry-run was triggered by `workflow_dispatch`, which the gate also accepts via `github.event_name == 'workflow_dispatch'`. The release-please-output branch of the OR was never exercised in any test.
What this PR does
Adds a third gate signal: `startsWith(github.event.head_commit.message, 'chore(main): release ')`. The release-please commit message format is stable and documented; that's how the rest of the GitHub ecosystem detects release-please merges too.
Consolidates version extraction into a single "Determine version" step that handles all three trigger sources:
The job-level `VERSION` env is dropped in favour of `echo VERSION=... >> $GITHUB_ENV` so the parsing logic can run in shell.
Verified locally
```
INPUT: chore(main): release 0.8.2
OUTPUT: v0.8.2
INPUT: chore(main): release 1.0.0-rc.1
OUTPUT: v1.0.0-rc.1
INPUT: feat: something else
OUTPUT: (empty — would fail with "Could not extract version")
```
The downstream regex (`^v[0-9]+.[0-9]+.[0-9]+(-[A-Za-z0-9.]+)?$`) is unchanged.
Test plan
🤖 Generated with Claude Code