Repository navigation
fix(ci): fail when a pull request changes a released changelog section - #600
Merged
Merged
Conversation
Contributor
PR Quality ReportCompared against base branch Coverage and tests
Compatibility
Performance smokePerformance smoke was skipped for this PR because no perf-sensitive paths changed. State
|
Cutting a release while a branch is open makes a later rebase drop that branch's entries into the version section that was just materialized. The headings match on both sides, so git merges it without a conflict: nothing warns, and the entries end up attributed to a release that never contained them. Four branches in a row hit this. Compare everything from the first released version heading down against the base branch and fail if it differs. A deliberate edit of released history uses a docs(changelog) commit.
szibis
force-pushed
the
fix/changelog-released-section-guard
branch
from
September 23, 2026 08:14
0b53b2f to
19ce3cd
Compare
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.
The failure this catches
When a release is cut while a branch is open, rebasing that branch moves its CHANGELOG entries into the version section that was just materialized. Because the
### Fixed/### Addedheadings match on both sides, git merges it without a conflict — nothing warns, and the entries end up attributed to a release that never contained them.This happened on four branches in a row today (#597, #582, #587, #594), twice silently. Each time it was caught only because it was checked by hand afterwards; the gate itself was happy.
The check
For any pull request touching
CHANGELOG.md, everything from the first released version heading (## [x.y.z]) down must be byte-identical to the base branch. Released history is immutable once published.Escape hatches, both already in use here:
docs(changelog)commit.Verification
Simulated the exact trap on top of current main — one entry inserted at the top of the newest released section, everything else untouched:
Run against the four open branches that currently carry
[Unreleased]entries, all of which were repaired by hand:Gate unit tests: 27 pass (3 new — section extraction, the no-releases case, and
docs(changelog)detection).