diff --git a/tools/tasks/changelog/pusher.ts b/tools/tasks/changelog/pusher.ts index df351c3..d047c63 100644 --- a/tools/tasks/changelog/pusher.ts +++ b/tools/tasks/changelog/pusher.ts @@ -374,6 +374,7 @@ async function transformAllIssueURLs(changelog: string[]) { */ async function transformTags(message: string): Promise { const promises: Promise[] = []; + const transformed: Set = new Set(); if (message.search(/#\d+/) !== -1) { const matched = message.match(/#\d+/g) ?? []; for (const match of matched) { @@ -382,10 +383,14 @@ async function transformTags(message: string): Promise { if (!digitsMatch) continue; const digits = Number.parseInt(digitsMatch[0]); + if (transformed.has(digits)) continue; + transformed.add(digits); + // Get PR/Issue Info (PRs are listed in the Issue API Endpoint) promises.push( - getIssueURL(digits).then((url) => - message.replace(match, `[#${digits}](${url})`), + getIssueURL(digits).then( + (url) => + (message = message.replaceAll(match, `[#${digits}](${url})`)), ), ); }