Skip to content

Commit

Permalink
Merge pull request #290 from betadots/move_trivy
Browse files Browse the repository at this point in the history
move trivy to own pipeline
  • Loading branch information
rwaffen authored Feb 6, 2024
2 parents 8ab4c78 + eab48fb commit 8e45159
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@ jobs:
tags: 'ci/hdm:${{ github.sha }}'
push: false

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ci/hdm:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'

tests:
needs:
- shellcheck
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/trivy-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Trivy

on:
push:
branches:
- main
pull_request:
# The branches below must be a subset of the branches above
branches:
- main


jobs:
analyze:
name: 'Analyze'
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
tags: 'ci/hdm:${{ github.sha }}'
push: false

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ci/hdm:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'

0 comments on commit 8e45159

Please sign in to comment.