Skip to content

Commit

Permalink
improve Trivy Scanning step
Browse files Browse the repository at this point in the history
  • Loading branch information
fqjony committed Sep 12, 2024
1 parent f9a2fde commit 4b84683
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@ jobs:
- name: Trivy Scanning
run: |
trivy image --severity HIGH,CRITICAL --exit-code 1 --quiet udx-worker/udx-worker:latest | grep -v 'INFO' || exit 1
trivy image --severity HIGH,CRITICAL --exit-code 0 --quiet udx-worker/udx-worker:latest | tee trivy.log | grep -v 'INFO'
if grep -q "Total: 0 (HIGH: 0, CRITICAL: 0)" trivy.log; then
echo "No HIGH or CRITICAL vulnerabilities found."
else
echo "HIGH or CRITICAL vulnerabilities detected!"
exit 1
fi

0 comments on commit 4b84683

Please sign in to comment.