From ba3da31023548d8a0ad505de0a50688c5d8c0484 Mon Sep 17 00:00:00 2001 From: Bryan Karaffa Date: Fri, 10 Sep 2021 15:00:46 -0700 Subject: [PATCH] use JSON.stringify --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5f82890..31bda0c 100644 --- a/index.js +++ b/index.js @@ -209,7 +209,7 @@ const main = async () => { } const ignoredCounts = countIgnoredFindings(ignoredFindings) - const findings_details = findings.imageScanFindings.findings || new Array() + const findings_details = findings.imageScanFindings.findings || [] const counts = findings.imageScanFindings.findingSeverityCounts const critical = counts.CRITICAL || 0 const high = counts.HIGH || 0 @@ -229,7 +229,7 @@ const main = async () => { core.setOutput('ignored', ignored.toString()) core.setOutput('total', total.toString()) console.log('Findings:'); - console.log(findings_details.toString()) + console.log(JSON.stringify(findings_details)) console.log('Vulnerabilities found:') console.log(`${critical.toString().padStart(3, ' ')} Critical ${getCount('critical', ignoredCounts)}`) console.log(`${high.toString().padStart(3, ' ')} High ${getCount('high', ignoredCounts)}`)