Skip to content

Commit 6d5deb7

Browse files
authored
Match tags case-insensitively for uncommitted PRs (#76)
1 parent 5e7ecc0 commit 6d5deb7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/checks/addCommentToUncommittedPRs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe(addCommentToUncommittedPRs, () => {
6767
expect(mockAPI.issues.createComment).not.toHaveBeenCalled()
6868
})
6969

70-
for (const allowed of ["Experience Enhancement", "Committed", "help wanted"]) {
70+
for (const allowed of ["Experience Enhancement", "Committed", "Help Wanted", "help wanted"]) {
7171
it("Does not add a comment to an uncommented PR linked to a suggestion with the label " + allowed, async () => {
7272
const { mockAPI, api } = createMockGitHubClient()
7373

src/checks/addCommentToUncommittedPRs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export const addCommentToUncommittedPRs = async (api: Octokit, payload: PullRequ
2525
else {
2626
const isSuggestion = info.relatedIssues.some(issue => issue.labels?.find(l => {
2727
const name = typeof l === "string" ? l : l.name;
28-
return name === "Suggestion"
28+
return name?.toLowerCase() === "suggestion"
2929
}))
3030
const isCommitted = info.relatedIssues.some(issue => issue.labels?.find(l => {
3131
const name = typeof l === "string" ? l : l.name;
32-
return name === "Committed" || name === "Experience Enhancement" || name === "help wanted"
32+
return name?.toLowerCase() === "committed" || name?.toLowerCase() === "experience enhancement" || name?.toLowerCase() === "help wanted"
3333
}))
3434

3535
if (isSuggestion && !isCommitted) {

0 commit comments

Comments
 (0)