Unverified Commit 61c7011c authored by Derek Nola's avatar Derek Nola Committed by GitHub

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

parent c4c11e51
...@@ -39,9 +39,15 @@ jobs: ...@@ -39,9 +39,15 @@ jobs:
- name: Add Trivy Report to PR - name: Add Trivy Report to PR
run: | run: |
echo '```' | cat - trivy-report.txt > temp && mv temp trivy-report.txt sudo chown runner:runner trivy-report.txt
echo '```' >> trivy-report.txt if [ -s trivy-report.txt ] && [ -n "$(grep -v '^\s*$' trivy-report.txt)" ]; then
gh issue comment ${{ github.event.issue.number }} --edit-last -F trivy-report.txt 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 - name: Report Failure
if: ${{ failure() }} if: ${{ failure() }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment