Skip to content

Trivy

Trivy #142

Workflow file for this run

name: Trivy
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "19 7 * * 0"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
trivy:
name: 🔐 Trivy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run GoReleaser
uses: ./.github/workflows/goreleaser
id: goreleaser
with:
repository_url: "ghcr.io/spacelift-io/vcs-agent"
- name: Run Trivy vulnerability scanner (amd64)
uses: aquasecurity/trivy-action@master
with:
image-ref: "ghcr.io/spacelift-io/vcs-agent:${{ fromJson(steps.goreleaser.outputs.metadata).version }}-amd64"
format: "sarif"
output: "trivy-results-amd64.sarif"
severity: "CRITICAL,HIGH"
- name: Run Trivy vulnerability scanner (arm64)
uses: aquasecurity/trivy-action@master
with:
image-ref: "ghcr.io/spacelift-io/vcs-agent:${{ fromJson(steps.goreleaser.outputs.metadata).version }}-arm64"
format: "sarif"
output: "trivy-results-arm64.sarif"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to GitHub Security tab (amd64)
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results-amd64.sarif"
category: "Trivy (amd64)"
- name: Upload Trivy scan results to GitHub Security tab (arm64)
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results-arm64.sarif"
category: "Trivy (arm64)"