Skip to content

Commit

Permalink
feat: change execution order for scan vm vs iac
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorEulalio committed Apr 4, 2024
1 parent 7fb0096 commit 7cb62a8
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,25 @@ function composeFlags(opts) {
if (opts.extraParameters) {
flags += ` ${opts.extraParameters}`;
}
if (opts.mode && opts.mode == vmMode) {
flags += ` ${opts.imageTag || ""}`;
}

if (opts.mode && opts.mode == iacMode) {
flags += ` --iac `;
flags += ` --iac`;
}

if (opts.recursive) {
flags += ` -r `;
flags += ` -r`;
}

if (opts.minimumSeverity) {
flags += ` -f=${opts.minimumSeverity} `;
flags += ` -f=${opts.minimumSeverity}`;
}

if (opts.mode && opts.mode == vmMode) {
flags += ` ${opts.imageTag}`;
}

if (opts.mode && opts.mode == iacMode) {
flags += ` ${opts.iacScanPath} `;
flags += ` ${opts.iacScanPath}`;
}

return {
Expand Down Expand Up @@ -370,7 +371,7 @@ async function executeScan(envvars, flags) {

let start = performance.now();
let cmd = `./${cliScannerName} ${flags}`;
core.debug("Executing: " + cmd);
core.info("Executing: " + cmd);
let retCode = await exec.exec(cmd, null, scanOptions);
core.info("Image analysis took " + Math.round(performance.now() - start) + " milliseconds.");

Expand Down

0 comments on commit 7cb62a8

Please sign in to comment.