Skip to content

Update trivy workflow #5

Update trivy workflow

Update trivy workflow #5

Workflow file for this run

name: Trivy Vulnerability Scan
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
scan:
name: Trivy Vulnerability Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226
# Build Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and export Docker image
id: build-and-export
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: .
push: false
load: true
tags: 'pgschk/alpine-tookit:${{ github.sha }}'
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'pgschk/alpine-tookit:${{ github.sha }}'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM'