From b1adab7976597e4eacf420bbbf952dc82da3eee5 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Mon, 28 Aug 2023 16:53:32 -0400 Subject: [PATCH] chore: fix pr_list script --- .github/scripts/pr_list.mjs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/scripts/pr_list.mjs b/.github/scripts/pr_list.mjs index 8038a89..b7328e8 100644 --- a/.github/scripts/pr_list.mjs +++ b/.github/scripts/pr_list.mjs @@ -12,11 +12,15 @@ const historyFilePath = path.join(__dirname, '..', '..', 'HISTORY.md'); * @returns {string[]} */ function parsePRList(history) { - const prRegexp = /mongodb-legacy/issues\/(?\d+)\)/iu; - return history - .split('\n') - .map(line => prRegexp.exec(line)?.groups?.prNum ?? '') - .filter(prNum => prNum !== ''); + const prRegexp = /mongodb-legacy\/issues\/(?\d+)\)/iu; + 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' });