Skip to content

Commit

Permalink
Add scheduled scan
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainbourgeois committed Oct 23, 2023
1 parent 0ff96fe commit 4569fa9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/scheduled_scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Scheduled scan

on:
schedule:
- cron: '0 21 * * 0'

jobs:
scan:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install yq
run: |
sudo snap install yq
- name: Find version to scan
run: |
image_name="$(yq '.name' rockcraft.yaml)"
echo "image_name=${image_name}" >> $GITHUB_ENV
version="$(yq '.version' rockcraft.yaml)"
echo "version=${version}" >> $GITHUB_ENV
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: "ghcr.io/canonical/${{env.image_name}}:${{env.version}}"
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'

0 comments on commit 4569fa9

Please sign in to comment.