From 99d1d849600ef07258d79e6cc2df3f230a01b6bb Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 17 Feb 2021 14:59:08 -0500 Subject: [PATCH] respect verbosity from action to call grype Signed-off-by: Alfredo Deza --- dist/index.js | 5 ++++- index.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index f9673c57..af6d5316 100644 --- a/dist/index.js +++ b/dist/index.js @@ -480,11 +480,15 @@ async function run() { var version = core.getInput("grype-version"); const billOfMaterialsPath = "./anchore-reports/content.json"; const SEVERITY_LIST = ["negligible", "low", "medium", "high", "critical"]; + let cmdArgs = []; console.log(billOfMaterialsPath); if (debug.toLowerCase() === "true") { debug = "true"; + cmdArgs = [`-vv`, `-o`, `json`]; + } else { debug = "false"; + cmdArgs = [`-o`, `json`]; } if (failBuild.toLowerCase() === "true") { @@ -528,7 +532,6 @@ async function run() { // Run the grype analyzer let cmdOutput = ""; let cmd = `${grypeBinary}`; - let cmdArgs = [`-vv`, `-o`, `json`]; if (severityCutoff != "") { cmdArgs.push("--fail-on"); cmdArgs.push(severityCutoff.toLowerCase()); diff --git a/index.js b/index.js index 87cb1849..7f94c67e 100644 --- a/index.js +++ b/index.js @@ -473,11 +473,15 @@ async function run() { var version = core.getInput("grype-version"); const billOfMaterialsPath = "./anchore-reports/content.json"; const SEVERITY_LIST = ["negligible", "low", "medium", "high", "critical"]; + let cmdArgs = []; console.log(billOfMaterialsPath); if (debug.toLowerCase() === "true") { debug = "true"; + cmdArgs = [`-vv`, `-o`, `json`]; + } else { debug = "false"; + cmdArgs = [`-o`, `json`]; } if (failBuild.toLowerCase() === "true") { @@ -521,7 +525,6 @@ async function run() { // Run the grype analyzer let cmdOutput = ""; let cmd = `${grypeBinary}`; - let cmdArgs = [`-vv`, `-o`, `json`]; if (severityCutoff != "") { cmdArgs.push("--fail-on"); cmdArgs.push(severityCutoff.toLowerCase());