Skip to content
Draft
42 changes: 42 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Trivy Image Scanner

on:
workflow_dispatch:
pull_request:
schedule:
- cron: 00 01 * * *

permissions:
contents: read

jobs:
latest-scan:
name: Scan Latest Image tag
runs-on: ubuntu-latest
steps:

- name: Pull image
run: docker pull ghcr.io/antonbabenko/pre-commit-terraform:latest

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0
with:
image-ref: ghcr.io/antonbabenko/pre-commit-terraform:latest
exit-code: '1'
severity: CRITICAL
ignore-unfixed: true

nightly-scan:
name: Scan Nightly Image tag
runs-on: ubuntu-latest
steps:
- name: Pull image
run: docker pull ghcr.io/antonbabenko/pre-commit-terraform:nightly

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0
with:
image-ref: ghcr.io/antonbabenko/pre-commit-terraform:nightly
exit-code: '1'
severity: CRITICAL
ignore-unfixed: true
Loading