File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ inputs:
1313 description : >-
1414 What Trivy data to cache; one or more of restore, save, success, or use.
1515
16+ database :
17+ default : update
18+ description : >-
19+ How Trivy should handle its data; one of update, only, or skip.
20+
1621 setup :
1722 default : v0.57.0,cache
1823 description : >-
6772 env :
6873 TRIVY_CACHE_DIR : >-
6974 ${{ contains(fromJSON(steps.parsed.outputs.cache), 'use') && inputs.cache-directory || '' }}
75+ TRIVY_DB_DOWNLOAD_ONLY : ${{ inputs.database == 'only' }}
76+ TRIVY_DB_SKIP_UPDATE : ${{ inputs.database == 'skip' }}
77+ TRIVY_DB_DOWNLOAD_JAVA_ONLY : ${{ inputs.database == 'only' }}
78+ TRIVY_DB_JAVA_SKIP_UPDATE : ${{ inputs.database == 'skip' }}
79+ TRIVY_REGO_SKIP_CHECK_UPDATE : ${{ inputs.database == 'skip' }}
7080 run : |
7181 # Run Trivy
7282 trivy '${{ inputs.scan-type }}' '${{ inputs.scan-target }}' || result=$?
Original file line number Diff line number Diff line change @@ -16,18 +16,25 @@ jobs:
1616 cache :
1717 # Run only one of these jobs at a time across the entire project.
1818 concurrency : { group: trivy-cache }
19+ # Do not fail this workflow when this job fails.
20+ continue-on-error : true
1921
2022 runs-on : ubuntu-latest
2123 steps :
2224 - uses : actions/checkout@v4
2325 - uses : ./.github/actions/trivy
2426 env :
25- TRIVY_DB_DOWNLOAD_ONLY : true
2627 TRIVY_DB_NO_PROGRESS : true
2728 TRIVY_SCANNERS : license,secret,vuln
29+ with :
30+ database : only
2831
2932 licenses :
33+ # Run this job after the cache job regardless of its success or failure.
3034 needs : [cache]
35+ if : >-
36+ ${{ !cancelled() }}
37+
3138 runs-on : ubuntu-latest
3239 steps :
3340 - uses : actions/checkout@v4
@@ -46,13 +53,16 @@ jobs:
4653 TRIVY_SCANNERS : license
4754 with :
4855 cache : restore,use
56+ database : skip
4957
5058 vulnerabilities :
51- if : ${{ github.repository == 'CrunchyData/postgres-operator' }}
59+ # Run this job after the cache job regardless of its success or failure.
60+ needs : [cache]
61+ if : >-
62+ ${{ github.repository == 'CrunchyData/postgres-operator' && !cancelled() }}
5263 permissions :
5364 security-events : write
5465
55- needs : [cache]
5666 runs-on : ubuntu-latest
5767 steps :
5868 - uses : actions/checkout@v4
6676 TRIVY_SCANNERS : secret,vuln
6777 with :
6878 cache : restore,use
79+ database : skip
6980
7081 # Produce a SARIF report of actionable results. This step fails only when
7182 # Trivy is unable to scan.
7889 TRIVY_SCANNERS : secret,vuln
7990 with :
8091 cache : use
92+ database : skip
8193 setup : none
8294
8395 # Submit the SARIF report to GitHub code scanning. Pull requests checks
You can’t perform that action at this time.
0 commit comments