Skip to content
This repository was archived by the owner on Aug 2, 2026. It is now read-only.

Scan Docker Image

Scan Docker Image #105

Workflow file for this run

name: Scan Docker Image
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 0 * * 0" # Run weekly on Sunday at midnight
jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
packages: read
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t temp-image:${{ github.sha }} .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: "temp-image:${{ github.sha }}"
format: "sarif"
output: "trivy-results.sarif"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: "trivy-results.sarif"