mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 21:46:01 +00:00
refactor(release): render only the selected contribution format (#16469)
This commit is contained in:
1 parent
ee683fe827
commit
2f0bfa1f31
1 file changed
+7
-9
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user