Skip to content

scan

scan #63

Workflow file for this run

name: scan
on:
workflow_run:
workflows: [docker_publish]
types: [completed]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
scan:
name: Scan docker image
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows/scan/html.tpl
sparse-checkout-cone-mode: false
- name: Run Trivy vulnerability scanner for alpine image
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/jim60105/ytarchive:alpine"
vuln-type: "os,library"
scanners: vuln
severity: "CRITICAL,HIGH"
format: "template"
template: "@.github/workflows/scan/html.tpl"
output: "trivy-results-alpine.html"
- name: Run Trivy vulnerability scanner for ubi image
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/jim60105/ytarchive:ubi"
vuln-type: "os,library"
scanners: vuln
severity: "CRITICAL,HIGH"
format: "template"
template: "@.github/workflows/scan/html.tpl"
output: "trivy-results-ubi.html"
- name: Run Trivy vulnerability scanner for distroless image
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/jim60105/ytarchive:distroless"
vuln-type: "os,library"
scanners: vuln
severity: "CRITICAL,HIGH"
format: "template"
template: "@.github/workflows/scan/html.tpl"
output: "trivy-results-distroless.html"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: trivy-results
path: trivy-results-*
retention-days: 90