Skip to content

Commit

Permalink
[CI] Update builds to that Trivy scan is in a separate job.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corneil du Plessis committed Nov 6, 2024
1 parent 533d788 commit 44f663d
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions .github/workflows/build-snapshot-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ jobs:
path: '**/surefire-reports/*.xml'
reporter: java-junit
list-tests: 'failed'
- 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'
# zoo success
- name: Notify Build Success Zoo Handler Controller
uses: jvalkeal/build-zoo-handler@v0.0.4
Expand All @@ -107,3 +95,29 @@ jobs:
- name: Clean cache
run: |
find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr
scan:
runs-on: ubuntu-latest
steps:
- 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'
- name: 'Scanned'
shell: bash
run: echo "::info ::Scanned"
done:
runs-on: ubuntu-latest
needs: [ scan, build ]
steps:
- name: 'Done'
shell: bash
run: echo "::info ::Done"

0 comments on commit 44f663d

Please sign in to comment.