Skip to content

Commit f601144

Browse files
committed
tools: fix failing release-proposal linter for LTS transitions
1 parent fb34515 commit f601144

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/actions/lint-release-proposal-commit-list.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ if (commitListingStart === -1) {
2626
commitList = changelog.replace(/(^.+\n### Semver-Major|\n### Semver-(Minor|Patch)) Commits\n/gs, '')
2727
.replaceAll('**(SEMVER-MAJOR)** ', '');
2828
} else {
29-
const commitListingEnd = changelog.indexOf('\n\n<a', commitListingStart);
30-
assert.notStrictEqual(commitListingEnd, -1);
29+
// We can't assume the Commits section is the one for this release in case of
30+
// a release to transition to LTS (i.e. with no commits).
31+
const releaseStart = /\n<a id="(\d+\.\d+\.\d+)"><\/a>\n\n## \d+-\d+-\d+, Version \1/.exec(changelog);
32+
assert.ok(releaseStart, 'Could not determine the start of the release section');
33+
const releaseEnd = changelog.indexOf('\n\n<a', releaseStart.index);
34+
assert.notStrictEqual(releaseEnd, -1, 'Could not determine the end of the release section');
3135
commitList = changelog.slice(commitListingStart, commitListingEnd + 1);
3236
}
3337

0 commit comments

Comments
 (0)