diff --git a/scripts/lib/release-notes.mjs b/scripts/lib/release-notes.mjs index e0e7c2e113d..28b82b21a93 100644 --- a/scripts/lib/release-notes.mjs +++ b/scripts/lib/release-notes.mjs @@ -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(