Skip to content

Detect release-please merge commit to fire release job#57

Merged
pthm merged 1 commit intomainfrom
release-please-merge-gate
May 6, 2026
Merged

Detect release-please merge commit to fire release job#57
pthm merged 1 commit intomainfrom
release-please-merge-gate

Conversation

@pthm
Copy link
Copy Markdown
Owner

@pthm pthm commented May 6, 2026

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

  1. 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.

  2. Consolidates version extraction into a single "Determine version" step that handles all three trigger sources:

    • `workflow_dispatch`: `github.event.inputs.version`
    • release-please owns the tag: `needs.release-please.outputs.tag_name`
    • merged release-PR push: parsed from the commit message (`chore(main): release 0.8.2` → `v0.8.2`)

    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

  • Once merged, the next `feat:` or `fix:` to land on `main` produces a release-please PR
  • Merging that PR fires the release job automatically (no manual `workflow_dispatch` needed)
  • Dry-runs via `workflow_dispatch` still work (preserves the existing path)

🤖 Generated with Claude Code

@pthm pthm merged commit b9c3356 into main May 6, 2026
8 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.35%. Comparing base (8d5271b) to head (3d24a2b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #57   +/-   ##
=======================================
  Coverage   83.35%   83.35%           
=======================================
  Files          79       79           
  Lines       10397    10397           
=======================================
  Hits         8666     8666           
  Misses       1396     1396           
  Partials      335      335           
Flag Coverage Δ
integration 78.13% <ø> (ø)
unit 25.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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