Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tools/actions/lint-release-proposal-commit-list.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading