From 71cc9962b4f1c0b8d8e3206f2dbcf17915ac17d0 Mon Sep 17 00:00:00 2001 From: pohanhuangtw Date: Tue, 19 Mar 2024 14:44:06 +0800 Subject: [PATCH] [NVSHAS-8797] Add variable to the GITHUB_OUTPUT for future reference --- run-scan.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/run-scan.sh b/run-scan.sh index 4fcbd49..f7fcf76 100755 --- a/run-scan.sh +++ b/run-scan.sh @@ -45,6 +45,10 @@ FOUND_MEDIUM=$(cat scan_result.json | jq '.report.vulnerabilities[] | select(.se VUL_LIST=$(printf '["%s"]' "${VUL_NAMES_TO_FAIL//,/\",\"}") VUL_LIST_FOUND=$(cat scan_result.json | jq --arg arr "$VUL_LIST" '.report.vulnerabilities[] | select(.name as $n | $arr | index($n)) |.name') +echo "vulnerability_count=$VUL_NUM" >> $env:GITHUB_OUTPUT +echo "high_vulnerability_count=$FOUND_HIGH" >> $env:GITHUB_OUTPUT +echo "medium_vulnerability_count=$FOUND_MEDIUM" >> $env:GITHUB_OUTPUT + # we must count the high and med before we put. if [[ -n $VUL_LIST_FOUND ]]; then fail_reason="Found specific named vulnerabilities."