Skip to content

Commit 169414b

Browse files
authored
Detect all PRs referenced in each change description (#84)
We now detect all referenced PRs in each change description, rather than just the first. This is especially helpful when one change entry references many PRs (e.g. a set of related bug fixes).
1 parent 221ebb9 commit 169414b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/update-changelog.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,9 @@ function getAllLoggedPrNumbers(changelog: Changelog) {
8888
const prNumbersWithChangelogEntries = [];
8989
for (const description of changeDescriptions) {
9090
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
91-
const matchResults = description!.match(/\[#(\d+)\]/u);
92-
if (matchResults === null) {
93-
continue;
94-
}
95-
const prNumber = matchResults[1];
96-
prNumbersWithChangelogEntries.push(prNumber);
91+
const matchResults = description!.matchAll(/\[#(\d+)\]/gu);
92+
const prNumbers = Array.from(matchResults, (result) => result[1]);
93+
prNumbersWithChangelogEntries.push(...prNumbers);
9794
}
9895

9996
return prNumbersWithChangelogEntries;

0 commit comments

Comments
 (0)