Skip to content

Commit

Permalink
style: fix js formatting issues (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
codfish committed Mar 22, 2024
1 parent 33f4833 commit 0715cae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions index.js
Expand Up @@ -86,12 +86,16 @@ async function action() {
if (labelsAreRegex) {
intersection = appliedLabels.filter((appliedLabel) =>
providedLabels.some((providedLabel) =>
new RegExp(providedLabel, 'i').test(appliedLabel)
new RegExp(providedLabel, "i").test(appliedLabel)
)
);
} else {
const lowerCasedAppliedLabels = appliedLabels.map((label) => label.toLowerCase());
intersection = providedLabels.filter((x) => lowerCasedAppliedLabels.includes(x.toLowerCase()));
const lowerCasedAppliedLabels = appliedLabels.map((label) =>
label.toLowerCase()
);
intersection = providedLabels.filter((x) =>
lowerCasedAppliedLabels.includes(x.toLowerCase())
);
}

// Is there an error?
Expand Down
5 changes: 4 additions & 1 deletion index.test.js
Expand Up @@ -474,7 +474,10 @@ describe("Required Labels", () => {

expect(core.setOutput).toBeCalledTimes(2);
expect(core.setOutput).toBeCalledWith("status", "success");
expect(core.setOutput).toBeCalledWith("labels", "Needs Code Review,Needs QA Review");
expect(core.setOutput).toBeCalledWith(
"labels",
"Needs Code Review,Needs QA Review"
);
});
});

Expand Down

0 comments on commit 0715cae

Please sign in to comment.