refactor(release): render only the selected contribution format (#16469)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-03 20:49:47 +00:00
1 parent ee683fe827
commit 2f0bfa1f31
1 file changed
+7 -9
+7 -9
View File
@@ -310,16 +310,14 @@ function verifyEditorialCredits(inventory, bullets) {
}
function editorialReleaseBlocks(notes, blocks, inventory) {
const record = contributionRecord(inventory).trim();
const summary = contributionSummary(inventory).trim();
const summaryOffset = notes.length - summary.length;
const expected = notes.endsWith(summary) ? summary : record;
const contributionStart =
expected === summary
? blocks.find(({ offset }) => offset === summaryOffset)
: blocks.find(
({ heading }) => heading === "### Complete contribution record",
);
const compact = notes.endsWith(summary);
const expected = compact ? summary : contributionRecord(inventory).trim();
const contributionStart = compact
? blocks.find(({ offset }) => offset === notes.length - summary.length)
: blocks.find(
({ heading }) => heading === "### Complete contribution record",
);
const start = contributionStart?.offset;
if (start === undefined || notes.slice(start).trim() !== expected)
throw new Error(