|
|
@ -80,15 +80,22 @@ async function main() { |
|
|
|
`${versionHeader}$|${versionHeader}\\s` |
|
|
|
`${versionHeader}$|${versionHeader}\\s` |
|
|
|
: currentDevelopBranchHeader; |
|
|
|
: currentDevelopBranchHeader; |
|
|
|
|
|
|
|
|
|
|
|
const releaseHeaderIndex = changelogLines.findIndex((line) => |
|
|
|
let releaseHeaderIndex = changelogLines.findIndex((line) => |
|
|
|
line.match(new RegExp(currentReleaseHeaderPattern, 'u')), |
|
|
|
line.match(new RegExp(currentReleaseHeaderPattern, 'u')), |
|
|
|
); |
|
|
|
); |
|
|
|
if (releaseHeaderIndex === -1) { |
|
|
|
if (releaseHeaderIndex === -1) { |
|
|
|
throw new Error( |
|
|
|
if (!isReleaseCandidate) { |
|
|
|
`Failed to find release header '${ |
|
|
|
throw new Error( |
|
|
|
isReleaseCandidate ? versionHeader : currentDevelopBranchHeader |
|
|
|
`Failed to find release header '${currentDevelopBranchHeader}'`, |
|
|
|
}'`,
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add release header if not found
|
|
|
|
|
|
|
|
const firstReleaseHeaderIndex = changelogLines.findIndex((line) => |
|
|
|
|
|
|
|
line.match(/## \d+\.\d+\.\d+/u), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
changelogLines.splice(firstReleaseHeaderIndex, 0, versionHeader, ''); |
|
|
|
|
|
|
|
releaseHeaderIndex = firstReleaseHeaderIndex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const prNumbersWithChangelogEntries = []; |
|
|
|
const prNumbersWithChangelogEntries = []; |
|
|
|