fix: assert no shipped changelog heading is deleted or duplicated #134

Merged
dan-claude-bot merged 5 commits from fix/changelog-monotonic into main 2026-07-20 23:37:02 +00:00
Showing only changes of commit 601f6168f5 - Show all commits

View file

@ -705,11 +705,16 @@ describe("changelog-monotonic.sh — release headings are append-only (#133)", (
/^ {6}- name: no shipped changelog heading/.test(l),
);
const after = ciLines.slice(monoStart + 1);
const monoEnd = after.findIndex((l) => /^ {6}- /.test(l) || /^ {2}\S/.test(l));
const monoEnd = after.findIndex(
(l) => /^ {6}- /.test(l) || /^ {2}\S/.test(l),
);
const monoBlock =
monoStart < 0
? undefined
: [ciLines[monoStart], ...after.slice(0, monoEnd < 0 ? after.length : monoEnd)].join("\n");
: [
ciLines[monoStart],
...after.slice(0, monoEnd < 0 ? after.length : monoEnd),
].join("\n");
expect(monoBlock).toBeDefined();
expect(monoBlock).toContain("changelog-monotonic.sh");
// Anchored: an `if:` inside a `run:` line is not a step condition.