Update dockerimage-trivy.yml #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scan Docker Image with Trivy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
scan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Run Trivy vulnerability scanner on Docker image | |
uses: aquasecurity/trivy-action@master | |
with: | |
scan-type: 'image' | |
image-ref: 'ezio22/myazurefunctionapp:latest' | |
format: 'table' | |
exit-code: '1' # Non-zero exit code if vulnerabilities are found | |
ignore-unfixed: false # Include unfixed vulnerabilities | |
severity: 'MEDIUM,HIGH,CRITICAL' | |
output: 'trivy-image-report.txt' | |
- name: Display Trivy scan results | |
run: cat trivy-image-report.txt || echo "Trivy report is empty or not found." | |
- name: Upload Trivy scan results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: trivy-report | |
path: trivy-image-report.txt |