Skip to content

Commit 58a7da1

Browse files
committed
Add security scanner
1 parent cfe0c0f commit 58a7da1

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/scan.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- ci-security-scan
8+
workflow_dispatch:
9+
pull_request:
10+
11+
# When a PR is updated, cancel the jobs from the previous version. Merges
12+
# do not define head_ref, so use run_id to never cancel those jobs.
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
cve-scanner:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
security-events: write
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
fetch-depth: 0
26+
27+
- name: Run vulnerability scanner
28+
uses: aquasecurity/trivy-action@master
29+
with:
30+
scan-type: 'fs'
31+
ignore-unfixed: true
32+
format: 'sarif'
33+
output: 'trivy-results.sarif'
34+
severity: 'HIGH,CRITICAL'
35+
36+
- name: Upload Trivy scan results to GitHub Security tab
37+
uses: github/codeql-action/upload-sarif@v3
38+
with:
39+
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)