Give good report if no CVEs found in trivy (#10853)

Signed-off-by: Derek Nola <derek.nola@suse.com>
pull/10791/head
Derek Nola 3 months ago committed by GitHub
parent c4c11e51f1
commit 61c7011cab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -39,9 +39,15 @@ jobs:
- name: Add Trivy Report to PR
run: |
echo '```' | cat - trivy-report.txt > temp && mv temp trivy-report.txt
echo '```' >> trivy-report.txt
gh issue comment ${{ github.event.issue.number }} --edit-last -F trivy-report.txt
sudo chown runner:runner trivy-report.txt
if [ -s trivy-report.txt ] && [ -n "$(grep -v '^\s*$' trivy-report.txt)" ]; then
echo '```' | cat - trivy-report.txt > temp && mv temp trivy-report.txt
echo '```' >> trivy-report.txt
gh issue comment ${{ github.event.issue.number }} --edit-last -F trivy-report.txt
else
echo ':star2: No High or Critical CVEs Found :star2:' > trivy-report.txt
gh issue comment ${{ github.event.issue.number }} --edit-last -F trivy-report.txt
fi
- name: Report Failure
if: ${{ failure() }}

Loading…
Cancel
Save