parent
6dbfc54184
commit
ccfcd1e583
@ -374,6 +374,7 @@ async function transformAllIssueURLs(changelog: string[]) {
|
|||||||
*/
|
*/
|
||||||
async function transformTags(message: string): Promise<string> {
|
async function transformTags(message: string): Promise<string> {
|
||||||
const promises: Promise<string>[] = [];
|
const promises: Promise<string>[] = [];
|
||||||
|
const transformed: Set<number> = new Set<number>();
|
||||||
if (message.search(/#\d+/) !== -1) {
|
if (message.search(/#\d+/) !== -1) {
|
||||||
const matched = message.match(/#\d+/g) ?? [];
|
const matched = message.match(/#\d+/g) ?? [];
|
||||||
for (const match of matched) {
|
for (const match of matched) {
|
||||||
@ -382,10 +383,14 @@ async function transformTags(message: string): Promise<string> {
|
|||||||
if (!digitsMatch) continue;
|
if (!digitsMatch) continue;
|
||||||
const digits = Number.parseInt(digitsMatch[0]);
|
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)
|
// Get PR/Issue Info (PRs are listed in the Issue API Endpoint)
|
||||||
promises.push(
|
promises.push(
|
||||||
getIssueURL(digits).then((url) =>
|
getIssueURL(digits).then(
|
||||||
message.replace(match, `[#${digits}](${url})`),
|
(url) =>
|
||||||
|
(message = message.replaceAll(match, `[#${digits}](${url})`)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user