Skip to content

trivy

trivy #14

Workflow file for this run

name: trivy
on:
pull_request:
types: [opened, edited, synchronize, reopened]
paths:
- "Dockerfile"
- "go.mod"
- "go.sum"
schedule:
# Run weekly on Monday at 08:00 UTC
- cron: "0 8 * * 1"
jobs:
trivy-scan:
name: trivy image scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # tag=v4.2.2
- name: Calculate go version
id: vars
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # tag=v6.0.0
with:
go-version: ${{ steps.vars.outputs.go_version }}
- name: Build image
run: |
make docker-build CONTROLLER_IMG_TAG=cluster-api-operator:ci
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # tag=0.34.2
with:
image-ref: "cluster-api-operator:ci"
format: "table"
exit-code: "1"
severity: "CRITICAL,HIGH"
ignore-unfixed: true