Skip to content

Commit

Permalink
Scan container images with Trivy (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbenjemaa authored Dec 17, 2024
1 parent 6a6309c commit 5391da8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/container-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
load: ${{ github.event_name == 'pull_request' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Scan image
if: github.event_name == 'pull_request'
uses: anchore/scan-action@v5
uses: aquasecurity/trivy-action@0.29.0
id: scan
with:
image: ${{ steps.meta.outputs.tags }}
add-cpes-if-none: true
output-format: table
scan-ref: ${{ steps.meta.outputs.tags }}
exit-code: '1'
ignore-unfixed: true
severity: 'HIGH,CRITICAL'

0 comments on commit 5391da8

Please sign in to comment.