Skip to content

Commit 3432a07

Browse files
committed
fix grype count
1 parent 6b18f3e commit 3432a07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/grype_scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ jobs:
113113
' result.json >> $GITHUB_STEP_SUMMARY
114114
fi
115115
116-
HIGH_COUNT=$(jq -r '.matches | map(.vulnerability.severity) | map(select(. == "High")) | length' result.json)
117-
CRITICAL_COUNT=$(jq -r '.matches | map(.vulnerability.severity) | map(select(. == "Critical")) | length' result.json)
116+
HIGH_COUNT=$(jq -r '.matches | map(.vulnerability) | unique_by(.id) | map(.severity) | map(select(. == "High")) | length' result.json)
117+
CRITICAL_COUNT=$(jq -r '.matches | map(.vulnerability) | unique_by(.id) | map(.severity) | map(select(. == "Critical")) | length' result.json)
118118
TOTAL_HIGH_CRITICAL=$((HIGH_COUNT + CRITICAL_COUNT))
119119
echo "total_high_critical=$TOTAL_HIGH_CRITICAL" >> $GITHUB_OUTPUT
120120

0 commit comments

Comments
 (0)