From f66e5c83f46768840d7701ff8bb95e4dffebd13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20S=C3=A5gfors?= Date: Thu, 4 Sep 2025 18:53:17 +0300 Subject: [PATCH] Match tags case-insensitively for uncommitted PRs --- src/checks/addCommentToUncommittedPRs.test.ts | 2 +- src/checks/addCommentToUncommittedPRs.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/checks/addCommentToUncommittedPRs.test.ts b/src/checks/addCommentToUncommittedPRs.test.ts index ff87706..77d2da9 100644 --- a/src/checks/addCommentToUncommittedPRs.test.ts +++ b/src/checks/addCommentToUncommittedPRs.test.ts @@ -67,7 +67,7 @@ describe(addCommentToUncommittedPRs, () => { expect(mockAPI.issues.createComment).not.toHaveBeenCalled() }) - for (const allowed of ["Experience Enhancement", "Committed", "help wanted"]) { + for (const allowed of ["Experience Enhancement", "Committed", "Help Wanted", "help wanted"]) { it("Does not add a comment to an uncommented PR linked to a suggestion with the label " + allowed, async () => { const { mockAPI, api } = createMockGitHubClient() diff --git a/src/checks/addCommentToUncommittedPRs.ts b/src/checks/addCommentToUncommittedPRs.ts index 8c5f718..d3c3bda 100644 --- a/src/checks/addCommentToUncommittedPRs.ts +++ b/src/checks/addCommentToUncommittedPRs.ts @@ -25,11 +25,11 @@ export const addCommentToUncommittedPRs = async (api: Octokit, payload: PullRequ else { const isSuggestion = info.relatedIssues.some(issue => issue.labels?.find(l => { const name = typeof l === "string" ? l : l.name; - return name === "Suggestion" + return name?.toLowerCase() === "suggestion" })) const isCommitted = info.relatedIssues.some(issue => issue.labels?.find(l => { const name = typeof l === "string" ? l : l.name; - return name === "Committed" || name === "Experience Enhancement" || name === "help wanted" + return name?.toLowerCase() === "committed" || name?.toLowerCase() === "experience enhancement" || name?.toLowerCase() === "help wanted" })) if (isSuggestion && !isCommitted) {