diff --git a/tools/actions/lint-release-proposal-commit-list.mjs b/tools/actions/lint-release-proposal-commit-list.mjs index fa5ebf79cdfe..12edd427d27a 100755 --- a/tools/actions/lint-release-proposal-commit-list.mjs +++ b/tools/actions/lint-release-proposal-commit-list.mjs @@ -20,13 +20,19 @@ import { createInterface } from 'node:readline'; const stdinLineByLine = createInterface(process.stdin)[Symbol.asyncIterator](); const changelog = await readFile(CHANGELOG_PATH, 'utf-8'); -const commitListingStart = changelog.indexOf('\n### Commits\n'); +let commitListingStart = changelog.indexOf('\n### Commits\n'); let commitList; +// Whether every commit listed in the changelog must be in the proposal. +let listMustMatchProposal = true; if (commitListingStart === -1) { - // We're preparing a semver-major release. - assert.match(changelog, /\n### Semver-Major Commits\n/); - // The proposal should contain only the release commit. - commitList = ''; + // We're preparing the first release of a new release line: the changelog + // lists every commit since the previous release line, most of them already on + // the release branch, so the proposal only contains a subset of the list. + commitListingStart = changelog.indexOf('\n### Semver-Major Commits\n'); + assert.notStrictEqual(commitListingStart, -1, 'Could not find the commit list'); + const releaseEnd = changelog.indexOf('\n\n