Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions snyk-parser.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ if [ ! -f snyk.json ]; then
exit 1
fi

echo "Normalizing snyk.json structure..."
if jq -e 'type == "array"' snyk.json >/dev/null 2>&1; then
echo " -> snyk.json is an array (multi-project output), merging all vulnerabilities..."
merged=$(jq '{ vulnerabilities: [ .[].vulnerabilities[]? ] }' snyk.json)
echo "$merged" > snyk.json
else
echo " -> snyk.json is a single object, no normalization needed"
fi

# Load thresholds from environment (inputs provided by action.yml)
MAX_CRITICAL_ISSUES="${MAX_CRITICAL_ISSUES:-1}"
MAX_HIGH_ISSUES="${MAX_HIGH_ISSUES:-1}"
Expand Down