Create scan.yml

This commit is contained in:
Wonderfall 2021-05-09 00:22:22 +02:00 committed by GitHub
parent d27f6f8344
commit bd5c77d43f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

26
.github/workflows/scan.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: build
on:
schedule:
# Scan the image regularly (once a day)
- cron: '13 02 * * *'
jobs:
build:
name: Scan current image & report results
runs-on: "ubuntu-20.04"
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ghcr.io/wonderfall/mastodon'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
vuln-type: "os"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: 'trivy-results.sarif'