[CI] Make Trivy scan fail build
This makes Trivy fail the build when a CVE is encountered.
This commit is contained in:
9
.github/workflows/common.yml
vendored
9
.github/workflows/common.yml
vendored
@@ -48,19 +48,14 @@ jobs:
|
||||
if: ${{ inputs.enableSecurityScan && github.repository == 'spring-cloud/stream-applications' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@master
|
||||
with:
|
||||
scan-type: 'fs'
|
||||
ignore-unfixed: true
|
||||
format: 'sarif'
|
||||
output: 'trivy-results.sarif'
|
||||
severity: 'CRITICAL,HIGH'
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
with:
|
||||
sarif_file: 'trivy-results.sarif'
|
||||
exit-code: 1
|
||||
- name: 'Scanned'
|
||||
shell: bash
|
||||
run: echo "::info ::Scanned"
|
||||
|
||||
Reference in New Issue
Block a user