mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Add release header when updating changelog (#10794)
The changelog update script now adds a release header if it doesn't find one already that matches the current release candidate version.
This commit is contained in:
parent
b2f6aa9f65
commit
5b5a4f6fd9
@ -80,15 +80,22 @@ async function main() {
|
||||
`${versionHeader}$|${versionHeader}\\s`
|
||||
: currentDevelopBranchHeader;
|
||||
|
||||
const releaseHeaderIndex = changelogLines.findIndex((line) =>
|
||||
let releaseHeaderIndex = changelogLines.findIndex((line) =>
|
||||
line.match(new RegExp(currentReleaseHeaderPattern, 'u')),
|
||||
);
|
||||
if (releaseHeaderIndex === -1) {
|
||||
throw new Error(
|
||||
`Failed to find release header '${
|
||||
isReleaseCandidate ? versionHeader : currentDevelopBranchHeader
|
||||
}'`,
|
||||
if (!isReleaseCandidate) {
|
||||
throw new Error(
|
||||
`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 = [];
|
||||
|
Loading…
Reference in New Issue
Block a user