Skip to content

Commit

Permalink
[NVSHAS-8797] Add variable to the GITHUB_OUTPUT for future reference
Browse files Browse the repository at this point in the history
  • Loading branch information
pohanhuangtw committed Mar 19, 2024
1 parent a171182 commit 71cc996
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions run-scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 71cc996

Please sign in to comment.