Skip to content

Commit

Permalink
Fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
asein-sinch committed Apr 15, 2024
1 parent 15bf215 commit 2faef7b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/scripts/validate-audit-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ echo ']}' >> audit-report.json
jq '.vulnerabilities |= map(select(.data.resolution.path | type == "string" and startswith("lerna") | not))' audit-report.json > audit-report-filtered.json

# Fail the build if filtered JSON array contains audit advisories
if jq '.vulnerabilities[] | select(.type == "auditAdvisory")' audit-report-filtered.json > /dev/null; then
if [ "$(jq '.vulnerabilities[] | select(.type == "auditAdvisory") | .type' audit-report-filtered.json | wc -l)" -gt 0 ]; then
echo "Audit advisories found. Printing details:"
jq '.vulnerabilities[] | select(.type == "auditAdvisory")' audit-report-filtered.json
echo "Failing the build."
exit 1
jq '.vulnerabilities[] | select(.type == "auditAdvisory")' audit-report-filtered.json
echo "Failing the build."
exit 1
else
echo "No audit advisories found."
fi

0 comments on commit 2faef7b

Please sign in to comment.