Skip to content

Update dockerimage-trivy.yml #5

Update dockerimage-trivy.yml

Update dockerimage-trivy.yml #5

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