diff --git a/.github/scripts/highlights.mjs b/.github/scripts/highlights.mjs index 49cea1bff1..6df213dced 100644 --- a/.github/scripts/highlights.mjs +++ b/.github/scripts/highlights.mjs @@ -70,7 +70,10 @@ async function pullRequestHighlights(prs) { if (!highlights.length) return ''; highlights.unshift('## Release Notes\n\n'); - return highlights.join('\n\n'); + + const highlight = highlights.join('\n\n'); + console.log(`Total highlight is ${highlight.length} characters long`); + return highlight; } console.log('List of PRs to collect highlights from:', prs); diff --git a/.github/scripts/pr_list.mjs b/.github/scripts/pr_list.mjs index 68639e2dea..6b31cd25c1 100644 --- a/.github/scripts/pr_list.mjs +++ b/.github/scripts/pr_list.mjs @@ -13,10 +13,14 @@ const historyFilePath = path.join(__dirname, '..', '..', 'HISTORY.md'); */ function parsePRList(history) { const prRegexp = /node-mongodb-native\/issues\/(?\d+)\)/iu; - return history - .split('\n') - .map(line => prRegexp.exec(line)?.groups?.prNum ?? '') - .filter(prNum => prNum !== ''); + return Array.from( + new Set( + history + .split('\n') + .map(line => prRegexp.exec(line)?.groups?.prNum ?? '') + .filter(prNum => prNum !== '') + ) + ); } const historyContents = await fs.readFile(historyFilePath, { encoding: 'utf8' });