Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
patheard committed Sep 8, 2023
1 parent 93d176f commit e5453b1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 22 deletions.
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.

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

0 comments on commit e5453b1

Please sign in to comment.