tools: fix failing release-proposal linter for LTS transitions

PR-URL: https://github.com/nodejs/node/pull/60465
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Antoine du Hamel 2025-10-30 18:29:10 +01:00 committed by GitHub
parent bdf03bfcd5
commit fdcf4d9454
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,9 +26,13 @@ if (commitListingStart === -1) {
commitList = changelog.replace(/(^.+\n### Semver-Major|\n### Semver-(Minor|Patch)) Commits\n/gs, '')
.replaceAll('**(SEMVER-MAJOR)** ', '');
} else {
const commitListingEnd = changelog.indexOf('\n\n<a', commitListingStart);
assert.notStrictEqual(commitListingEnd, -1);
commitList = changelog.slice(commitListingStart, commitListingEnd + 1);
// We can't assume the Commits section is the one for this release in case of
// a release to transition to LTS (i.e. with no commits).
const releaseStart = /\n<a id="(\d+\.\d+\.\d+)"><\/a>\n\n## \d+-\d+-\d+, Version \1/.exec(changelog);
assert.ok(releaseStart, 'Could not determine the start of the release section');
const releaseEnd = changelog.indexOf('\n\n<a', releaseStart.index);
assert.notStrictEqual(releaseEnd, -1, 'Could not determine the end of the release section');
commitList = changelog.slice(commitListingStart, releaseEnd + 1);
}
// Normalize for consistent comparison