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

chore(deps): update dependency prettier to v3 #232

Merged
merged 2 commits into from
Sep 8, 2023
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
13 changes: 7 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16128,7 +16128,7 @@ const action = async () => {
// Check for hashicorp/setup-terraform action's terraform_wrapper output
if (results[command.key].output.indexOf("::debug::exitcode:") > -1) {
core.setFailed(
"Error: `hashicorp/setup-terraform` must have `terraform_wrapper: false`"
"Error: `hashicorp/setup-terraform` must have `terraform_wrapper: false`",
);
return;
}
Expand Down Expand Up @@ -16160,7 +16160,7 @@ const action = async () => {
planLimit,
conftestLimit,
skipPlan,
skipConftest
skipConftest,
);
}

Expand All @@ -16169,7 +16169,7 @@ const action = async () => {
.filter((c) => !results[c.key].isSuccess)
.map((c) => c.exec);
core.setFailed(
`The following commands failed:\n${failedCommands.join("\n")}`
`The following commands failed:\n${failedCommands.join("\n")}`,
);
}
};
Expand Down Expand Up @@ -16346,7 +16346,7 @@ const addComment = async (
planLimit,
conftestLimit,
skipPlan,
skipConftest
skipConftest,
) => {
const format = cleanFormatOutput(results.fmt.output);
const plan = skipPlan ? "" : removePlanRefresh(results.plan.output);
Expand Down Expand Up @@ -16384,7 +16384,8 @@ const deleteComment = async (octokit, context, title) => {

// Find the bot's comment
const comment = comments.find(
(comment) => comment.user.type === "Bot" && comment.body.indexOf(title) > -1
(comment) =>
comment.user.type === "Bot" && comment.body.indexOf(title) > -1,
);
if (comment) {
console.log(`Deleting comment '${title}: ${comment.id}'`);
Expand Down Expand Up @@ -16457,7 +16458,7 @@ const noChangesFound = (resources, outputs) => {

const countResourceChanges = (tfPlan, action) => {
const actions = tfPlan.resource_changes.filter((res) =>
res.change.actions.includes(action)
res.change.actions.includes(action),
);
return actions.length;
};
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"jest": "29.6.4",
"jest-when": "3.6.0",
"mock-fs": "^5.2.0",
"prettier": "2.8.8"
"prettier": "3.0.3"
}
}
6 changes: 3 additions & 3 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const action = async () => {
// Check for hashicorp/setup-terraform action's terraform_wrapper output
if (results[command.key].output.indexOf("::debug::exitcode:") > -1) {
core.setFailed(
"Error: `hashicorp/setup-terraform` must have `terraform_wrapper: false`"
"Error: `hashicorp/setup-terraform` must have `terraform_wrapper: false`",
);
return;
}
Expand Down Expand Up @@ -158,7 +158,7 @@ const action = async () => {
planLimit,
conftestLimit,
skipPlan,
skipConftest
skipConftest,
);
}

Expand All @@ -167,7 +167,7 @@ const action = async () => {
.filter((c) => !results[c.key].isSuccess)
.map((c) => c.exec);
core.setFailed(
`The following commands failed:\n${failedCommands.join("\n")}`
`The following commands failed:\n${failedCommands.join("\n")}`,
);
}
};
Expand Down
5 changes: 3 additions & 2 deletions src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const addComment = async (
planLimit,
conftestLimit,
skipPlan,
skipConftest
skipConftest,
) => {
const format = cleanFormatOutput(results.fmt.output);
const plan = skipPlan ? "" : removePlanRefresh(results.plan.output);
Expand Down Expand Up @@ -145,7 +145,8 @@ const deleteComment = async (octokit, context, title) => {

// Find the bot's comment
const comment = comments.find(
(comment) => comment.user.type === "Bot" && comment.body.indexOf(title) > -1
(comment) =>
comment.user.type === "Bot" && comment.body.indexOf(title) > -1,
);
if (comment) {
console.log(`Deleting comment '${title}: ${comment.id}'`);
Expand Down
2 changes: 1 addition & 1 deletion src/opa.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const noChangesFound = (resources, outputs) => {

const countResourceChanges = (tfPlan, action) => {
const actions = tfPlan.resource_changes.filter((res) =>
res.change.actions.includes(action)
res.change.actions.includes(action),
);
return actions.length;
};
Expand Down
10 changes: 5 additions & 5 deletions test/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("action", () => {
when(core.getInput)
.calledWith("conftest-checks")
.mockReturnValue(
"git::https://github.com/cds-snc/opa_checks.git//aws_terraform"
"git::https://github.com/cds-snc/opa_checks.git//aws_terraform",
);
when(core.getMultilineInput)
.calledWith("terraform-init")
Expand Down Expand Up @@ -122,7 +122,7 @@ describe("action", () => {
when(core.getInput)
.calledWith("conftest-checks")
.mockReturnValue(
"git::https://github.com/cds-snc/opa_checks.git//aws_terraform"
"git::https://github.com/cds-snc/opa_checks.git//aws_terraform",
);
when(core.getBooleanInput).calledWith("terragrunt").mockReturnValue(true);

Expand Down Expand Up @@ -267,7 +267,7 @@ describe("action", () => {
when(core.getInput)
.calledWith("conftest-checks")
.mockReturnValue(
"git::https://github.com/cds-snc/opa_checks.git//aws_terraform"
"git::https://github.com/cds-snc/opa_checks.git//aws_terraform",
);
await action();

Expand Down Expand Up @@ -323,7 +323,7 @@ conftest test plan.json --no-color --update git::https://github.com/cds-snc/opa_

expect(core.setFailed.mock.calls.length).toBe(1);
expect(core.setFailed.mock.calls[0][0]).toBe(
`Directory ${directory} does not exist`
`Directory ${directory} does not exist`,
);
});

Expand All @@ -336,7 +336,7 @@ conftest test plan.json --no-color --update git::https://github.com/cds-snc/opa_

expect(core.setFailed.mock.calls.length).toBe(1);
expect(core.setFailed.mock.calls[0][0]).toBe(
"You must pass a GitHub token to comment on PRs"
"You must pass a GitHub token to comment on PRs",
);
});

Expand Down
2 changes: 1 addition & 1 deletion test/command.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("execCommand", () => {
};
});
expect(
execCommand({ exec: "terragrunt init", output: false }, ".")
execCommand({ exec: "terragrunt init", output: false }, "."),
).toEqual({
isSuccess: false,
output: "well this is awkward",
Expand Down
6 changes: 3 additions & 3 deletions test/github.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Plan: 1 to add, 0 to change, 0 to destroy
changes,
10000,
10000,
false
false,
);
expect(octomock.rest.issues.createComment.mock.calls.length).toBe(1);
expect(octomock.rest.issues.createComment.mock.calls[0]).toEqual([
Expand Down Expand Up @@ -304,7 +304,7 @@ Hello there
{},
1000,
1000,
true
true,
);
expect(octomock.rest.issues.createComment.mock.calls.length).toBe(1);
expect(octomock.rest.issues.createComment.mock.calls[0][0]).toEqual({
Expand Down Expand Up @@ -381,7 +381,7 @@ Plan: 1 to add, 0 to change, 0 to destroy
changes,
10,
10000,
false
false,
);
expect(octomock.rest.issues.createComment.mock.calls.length).toBe(1);
expect(octomock.rest.issues.createComment.mock.calls[0]).toEqual([
Expand Down
Loading