Skip to content

Instantly share code, notes, and snippets.

@initcron
Created June 9, 2025 15:24
Show Gist options
  • Save initcron/dedbe8a2ae23c7ebab901654b4a3eb63 to your computer and use it in GitHub Desktop.
Save initcron/dedbe8a2ae23c7ebab901654b4a3eb63 to your computer and use it in GitHub Desktop.
name: Trivy Vulnerability Scan
on:
push:
branches: [ main, master ]
pull_request:
workflow_dispatch:
jobs:
trivy:
name: Run Trivy Scan
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
run: docker build -t vote:test .
- name: Run Trivy Scan
uses: aquasecurity/trivy-action@master
with:
image-ref: 'vote:test'
format: 'table'
exit-code: '0'
severity: 'CRITICAL,HIGH'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment