Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dependencies #83

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ async function action() {
octokit,
shouldAddComment,
`Unknown mode input [${mode}]. Must be one of: ${allowedModes.join(
", "
)}`
", ",
)}`,
);
return;
}
Expand All @@ -63,8 +63,8 @@ async function action() {
octokit,
shouldAddComment,
`Unknown exit_code input [${exitType}]. Must be one of: ${allowedExitCodes.join(
", "
)}`
", ",
)}`,
);
return;
}
Expand All @@ -86,15 +86,15 @@ 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()
label.toLowerCase(),
);
intersection = providedLabels.filter((x) =>
lowerCasedAppliedLabels.includes(x.toLowerCase())
lowerCasedAppliedLabels.includes(x.toLowerCase()),
);
}

Expand Down Expand Up @@ -131,7 +131,7 @@ async function action() {
});

const generatedComment = existing.find((c) =>
c.body.includes(matchToken)
c.body.includes(matchToken),
);
if (generatedComment) {
await octokit.rest.issues.deleteComment({
Expand Down
42 changes: 21 additions & 21 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ describe("Required Labels", () => {
if (!nock.isDone()) {
throw new Error(
`Not all nock interceptors were used: ${JSON.stringify(
nock.pendingMocks()
)}`
nock.pendingMocks(),
)}`,
);
}
nock.cleanAll();
Expand Down Expand Up @@ -80,7 +80,7 @@ describe("Required Labels", () => {
expect(core.setOutput).toBeCalledWith("status", "failure");
expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires exactly 1 of: enhancement. Found: bug"
"Label error. Requires exactly 1 of: enhancement. Found: bug",
);
});

Expand Down Expand Up @@ -254,7 +254,7 @@ describe("Required Labels", () => {
expect(core.setOutput).toBeCalledWith("status", "failure");
expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug"
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug",
);
});

Expand All @@ -273,7 +273,7 @@ describe("Required Labels", () => {
expect(core.setOutput).toBeCalledWith("status", "failure");
expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires exactly 1 of: enhance.*, bug. Found: enhancement, bug"
"Label error. Requires exactly 1 of: enhance.*, bug. Found: enhancement, bug",
);
});

Expand All @@ -292,7 +292,7 @@ describe("Required Labels", () => {
expect(core.setOutput).toBeCalledWith("status", "failure");
expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires exactly 1 of: enhance.*, bug. Found: enhancement, bug"
"Label error. Requires exactly 1 of: enhance.*, bug. Found: enhancement, bug",
);
});

Expand All @@ -310,7 +310,7 @@ describe("Required Labels", () => {
expect(core.setOutput).toBeCalledWith("status", "failure");
expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires at least 2 of: enhancement, bug, triage. Found: enhancement"
"Label error. Requires at least 2 of: enhancement, bug, triage. Found: enhancement",
);
});

Expand All @@ -327,7 +327,7 @@ describe("Required Labels", () => {
expect(core.setOutput).toBeCalledWith("status", "failure");
expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires at most 2 of: enhancement, bug, triage. Found: enhancement, triage, bug"
"Label error. Requires at most 2 of: enhancement, bug, triage. Found: enhancement, triage, bug",
);
});
});
Expand All @@ -340,7 +340,7 @@ describe("Required Labels", () => {

expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Input required and not supplied: mode"
"Input required and not supplied: mode",
);
});

Expand All @@ -354,7 +354,7 @@ describe("Required Labels", () => {

expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Input required and not supplied: count"
"Input required and not supplied: count",
);
});

Expand All @@ -368,7 +368,7 @@ describe("Required Labels", () => {

expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Input required and not supplied: labels"
"Input required and not supplied: labels",
);
});

Expand All @@ -383,7 +383,7 @@ describe("Required Labels", () => {

expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Unknown mode input [bananas]. Must be one of: exactly, minimum, maximum"
"Unknown mode input [bananas]. Must be one of: exactly, minimum, maximum",
);
});

Expand All @@ -399,7 +399,7 @@ describe("Required Labels", () => {

expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Unknown exit_code input [other]. Must be one of: success, failure"
"Unknown exit_code input [other]. Must be one of: success, failure",
);
});
});
Expand Down Expand Up @@ -476,7 +476,7 @@ describe("Required Labels", () => {
expect(core.setOutput).toBeCalledWith("status", "success");
expect(core.setOutput).toBeCalledWith(
"labels",
"Needs Code Review,Needs QA Review"
"Needs Code Review,Needs QA Review",
);
});
});
Expand All @@ -494,7 +494,7 @@ describe("Required Labels", () => {

expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug"
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug",
);
});

Expand All @@ -511,7 +511,7 @@ describe("Required Labels", () => {

expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug"
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug",
);
});

Expand All @@ -528,7 +528,7 @@ describe("Required Labels", () => {

expect(core.warning).toBeCalledTimes(1);
expect(core.warning).toBeCalledWith(
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug"
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug",
);
});
});
Expand All @@ -547,7 +547,7 @@ describe("Required Labels", () => {

expect(core.setFailed).toBeCalledTimes(1);
expect(core.setFailed).toBeCalledWith(
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug"
"Label error. Requires exactly 1 of: enhancement, bug. Found: enhancement, bug",
);
});

Expand Down Expand Up @@ -657,7 +657,7 @@ function mockPr(env) {
labels: [],
},
},
env
env,
);
}

Expand All @@ -668,7 +668,7 @@ function mockLabels(labels) {
200,
labels.map((name) => {
return { name };
})
}),
);
}

Expand All @@ -679,7 +679,7 @@ function mockListComments(comments) {
200,
comments.map((c) => {
return { body: c.body, id: c.id };
})
}),
);
}

Expand Down
Loading
Loading