Skip to content

Commit

Permalink
fix: command
Browse files Browse the repository at this point in the history
  • Loading branch information
swarit-pandey committed Aug 23, 2024
1 parent 9fde822 commit 161a1b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,16 @@ async function runKnoxctlScan(): Promise<void> {
{ name: "output", flag: "--output", type: "string" },
];

const policyAction = core.getInput("policy_action").toLowerCase();
let policyAction = core.getInput("policy_action").toLowerCase();
if (policyAction !== "audit" && policyAction !== "block") {
throw new Error(
"Invalid policy_action. Must be either 'Audit' or 'Block'.",
);
}

// Capitalize the first letter
policyAction = policyAction.charAt(0).toUpperCase() + policyAction.slice(1);

// Run the policy command first
await exec.exec("knoxctl", [
"scan",
Expand Down

0 comments on commit 161a1b9

Please sign in to comment.