Skip to content

Commit 45f8fb9

Browse files
authored
chore(NODE-5544): fix duplicate PR highlights (#3816)
1 parent bd031fc commit 45f8fb9

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/scripts/highlights.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ async function pullRequestHighlights(prs) {
7070
if (!highlights.length) return '';
7171

7272
highlights.unshift('## Release Notes\n\n');
73-
return highlights.join('\n\n');
73+
74+
const highlight = highlights.join('\n\n');
75+
console.log(`Total highlight is ${highlight.length} characters long`);
76+
return highlight;
7477
}
7578

7679
console.log('List of PRs to collect highlights from:', prs);

.github/scripts/pr_list.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ const historyFilePath = path.join(__dirname, '..', '..', 'HISTORY.md');
1313
*/
1414
function parsePRList(history) {
1515
const prRegexp = /node-mongodb-native\/issues\/(?<prNum>\d+)\)/iu;
16-
return history
17-
.split('\n')
18-
.map(line => prRegexp.exec(line)?.groups?.prNum ?? '')
19-
.filter(prNum => prNum !== '');
16+
return Array.from(
17+
new Set(
18+
history
19+
.split('\n')
20+
.map(line => prRegexp.exec(line)?.groups?.prNum ?? '')
21+
.filter(prNum => prNum !== '')
22+
)
23+
);
2024
}
2125

2226
const historyContents = await fs.readFile(historyFilePath, { encoding: 'utf8' });

0 commit comments

Comments
 (0)