workflows #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trivy Container Image Scan | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build an image from Dockerfile | |
run: | | |
docker build -f /Dockerfile -t docker.io/tquinnelly/clamav-alpine:${{ github.sha }} . | |
- name: Run Trivy vulnerability scanner for latest | |
uses: aquasecurity/trivy-action@0.20.0 | |
with: | |
image-ref: 'docker.io/tquinnelly/clamav-alpine:${{ github.sha }}' | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
- name: Build an image from Dockerfile | |
run: | | |
docker build -f /Dockerfile-edge.dockerfile -t docker.io/tquinnelly/clamav-alpine:${{ github.sha }} . | |
- name: Run Trivy vulnerability scanner for latest | |
uses: aquasecurity/trivy-action@0.20.0 | |
with: | |
image-ref: 'docker.io/tquinnelly/clamav-alpine:${{ github.sha }}' | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v2 | |
if: always() | |
with: | |
sarif_file: 'trivy-results.sarif' |