From 688cbaf9e29d9980d02ec3706f0b24af1279869a Mon Sep 17 00:00:00 2001 From: Bryan Karaffa Date: Wed, 15 Sep 2021 10:03:51 -0700 Subject: [PATCH] feat: format findings based on review feedback --- index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 31bda0c..0e086fc 100644 --- a/index.js +++ b/index.js @@ -228,8 +228,15 @@ const main = async () => { core.setOutput('undefined', indeterminate.toString()) core.setOutput('ignored', ignored.toString()) core.setOutput('total', total.toString()) - console.log('Findings:'); - console.log(JSON.stringify(findings_details)) + core.startGroup('Findings'); + findings_details.forEach(function(finding_detail,index){ + let finding_attributes = []; + finding_detail.attributes.forEach(function(attribute){ + finding_attributes.push(attribute.key+"="+attribute.value); + }); + console.log(index+1 +'. '+finding_detail.name+' ('+finding_detail.severity+') '+finding_attributes.join(" ")); + }); + core.endGroup(); console.log('Vulnerabilities found:') console.log(`${critical.toString().padStart(3, ' ')} Critical ${getCount('critical', ignoredCounts)}`) console.log(`${high.toString().padStart(3, ' ')} High ${getCount('high', ignoredCounts)}`)