Skip to content

Commit

Permalink
respect verbosity from action to call grype
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@anchore.com>
  • Loading branch information
Alfredo Deza authored and alfredodeza committed Feb 25, 2021
1 parent 3c947f3 commit 6dd9b97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/index.js
Expand Up @@ -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") {
Expand Down Expand Up @@ -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());
Expand Down
5 changes: 4 additions & 1 deletion index.js
Expand Up @@ -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") {
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 6dd9b97

Please sign in to comment.