File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ # In your scan workflow, set TRIVY_SKIP_DB_UPDATE=true.
2+ name : Update the trivy cache
3+
4+ on :
5+ schedule :
6+ - cron : ' 0 0 * * *' # Run daily at midnight UTC
7+ workflow_dispatch : # Allow manual triggering
8+
9+ jobs :
10+ update-trivy-db :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Get current date
14+ id : date
15+ run : echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
16+
17+ - name : Download and extract the vulnerability DB
18+ run : |
19+ mkdir -p $GITHUB_WORKSPACE/.cache/trivy/db
20+ oras pull ghcr.io/aquasecurity/trivy-db:2
21+ tar -xzf db.tar.gz -C $GITHUB_WORKSPACE/.cache/trivy/db
22+ rm db.tar.gz
23+
24+ - name : Cache DBs
25+ uses : actions/cache/save@v4
26+ with :
27+ path : ${{ github.workspace }}/.cache/trivy
28+ key : cache-trivy-${{ steps.date.outputs.date }}
Original file line number Diff line number Diff line change 6060 load : true
6161 push : false
6262
63+ - name : Scan ${{ matrix.target }}
64+ uses : aquasecurity/trivy-action@0.27.0
65+ with :
66+ image-ref : " ${REPO}:${{ matrix.target }}"
67+ format : ' table'
68+ exit-code : ' 1'
69+ ignore-unfixed : true
70+ vuln-type : ' os,library'
71+ severity : ' CRITICAL,HIGH,MEDIUM'
72+ env :
73+ TRIVY_SKIP_DB_UPDATE : true
74+
6375 - name : Run ${{ matrix.target }}
6476 run : |
6577 echo "Starting container ${{ matrix.target }}"
You can’t perform that action at this time.
0 commit comments