From e7890fd889df98d1e18bd15c8cb559e7327b5b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= <4975670+0x4007@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:48:58 +0900 Subject: [PATCH] Apply suggestions from code review --- src/handlers/issue-deduplication.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/handlers/issue-deduplication.ts b/src/handlers/issue-deduplication.ts index 1da7bc6..abea2ea 100644 --- a/src/handlers/issue-deduplication.ts +++ b/src/handlers/issue-deduplication.ts @@ -102,18 +102,17 @@ async function handleSimilarIssuesComment(context: Context, payload: IssuePayloa }) ); - let finalIdx = 0; + let finalIndex = 0; const commentBody = issueList .filter((issue) => matchRepoOrgToSimilarIssueRepoOrg(payload.repository.owner.login, issue.node.repository.owner.login, payload.repository.name, issue.node.repository.name) ) .map((issue, index) => { const modifiedUrl = issue.node.url.replace("https://github.com", "https://www.github.com"); - finalIdx += 1; return `[^0${index + 1}^]: [${issue.node.title}](${modifiedUrl}) ${issue.similarity}%`; }) .join("\n"); - const footnoteLinks = [...Array(finalIdx).keys()].map((i) => `[^0${i + 1}^]`).join(""); + const footnoteLinks = [...Array(++finalIndex).keys()].map((i) => `[^0${i + 1}^]`).join(""); const body = "\n###### Similar " + footnoteLinks + "\n\n" + commentBody; // Remove the existing foot note