Skip to content

ci: let the semver gate see a break on a push, not only on a pull request - #138

Merged
vyncint merged 1 commit into
mainfrom
ci/semver-on-push
Sep 10, 2026
Merged

vyncint merged 1 commit into
mainfrom
ci/semver-on-push

Conversation

@vyncint

@vyncint vyncint commented Sep 10, 2026

Copy link
Copy Markdown
Owner

main is red right now, and this is why.

github.event.pull_request does not exist on a push, so

release-type: ${{ contains(github.event.pull_request.labels.*.name, 'breaking') && 'major' || 'patch' }}

silently yields patch there. #137 merged a deliberate break carrying the breaking label, was green as a pull request, and turned main red on the very next push — and would have stayed red until 0.7.0 moved the baseline.

The fix

The label was the wrong signal for a push. A break is declared twice now, and the second declaration is the CHANGELOG: a ### Breaking heading under ## [Unreleased], scoped to that section so a heading in an already-released one does not count.

That is the document a release is cut from, which makes the push gate mean something rather than nothing: merge a break without recording it and this fails. A better rule than the label alone, which said nothing at all after the merge.

Exercised, not assumed

tree release type
[Unreleased] contains ### Breaking major
it does not patch
the heading appears only under [0.6.1] patch

The third case is the one that makes it a real predicate rather than a grep for a string that appears somewhere in a 1200-line file.

docs/RELEASING.md records both declarations and why each exists.

Signed-off-by: Vyncint Ng 115854244+vyncint@users.noreply.github.com

…uest

`github.event.pull_request` does not exist on a push, so the `breaking`
label expression silently yielded `patch` there. #137 merged a deliberate
break with the label, was green as a pull request, and turned `main` red on
the very next push -- and would have stayed red until 0.7.0 moved the
baseline.

The label was the wrong signal for a push. A break is declared twice now,
and the second declaration is the CHANGELOG: a `### Breaking` heading under
`## [Unreleased]`, scoped to that section so a heading in a released one
does not count. That is the document a release is cut from, so tying the
gate to it means merging a break without recording it fails -- a better
rule than the label alone, which said nothing after the merge.

Exercised against three trees: `[Unreleased]` with the heading -> major,
without it -> patch, and the heading present only under `[0.6.1]` -> patch.

Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
@vyncint
vyncint merged commit 102c6f0 into main Sep 10, 2026
14 checks passed
@vyncint
vyncint deleted the ci/semver-on-push branch September 10, 2026 07:03
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