From e10428ed13e4fb16143f88770dff202c9433ad58 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Thu, 10 Apr 2025 17:54:45 -0300 Subject: [PATCH 1/2] tools: add semver-major release support to release-lint --- .../lint-release-proposal-commit-list.mjs | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/tools/actions/lint-release-proposal-commit-list.mjs b/tools/actions/lint-release-proposal-commit-list.mjs index b9745bad3c30c1..3d6598c61f805a 100755 --- a/tools/actions/lint-release-proposal-commit-list.mjs +++ b/tools/actions/lint-release-proposal-commit-list.mjs @@ -18,15 +18,34 @@ 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'); -const commitListingEnd = changelog.indexOf('\n\n Date: Thu, 10 Apr 2025 18:11:53 -0300 Subject: [PATCH 2/2] Update tools/actions/lint-release-proposal-commit-list.mjs Co-authored-by: Antoine du Hamel --- tools/actions/lint-release-proposal-commit-list.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/actions/lint-release-proposal-commit-list.mjs b/tools/actions/lint-release-proposal-commit-list.mjs index 3d6598c61f805a..8dccca4b33d447 100755 --- a/tools/actions/lint-release-proposal-commit-list.mjs +++ b/tools/actions/lint-release-proposal-commit-list.mjs @@ -44,7 +44,7 @@ commitList = commitList .replaceAll('**(SEMVER-MAJOR)** ', '') .replaceAll('\\', ''); -let expectedNumberOfCommitsLeft = (commitList.match(/\n\* \[/g) || []).length; +let expectedNumberOfCommitsLeft = commitList.match(/\n\* \[/g)?.length ?? 0; for await (const line of stdinLineByLine) { const { smallSha, title, prURL } = JSON.parse(line);