Skip to content

Commit b6544e0

Browse files
committed
Add security scanner
1 parent cfe0c0f commit b6544e0

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/scan.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
with:
26+
fetch-depth: 0
27+
28+
- name: Run vulnerability scanner
29+
uses: aquasecurity/trivy-action@master
30+
with:
31+
scan-type: 'fs'
32+
ignore-unfixed: true
33+
format: 'sarif'
34+
output: 'trivy-results.sarif'
35+
severity: 'HIGH,CRITICAL'
36+
37+
- name: Upload Trivy scan results to GitHub Security tab
38+
uses: github/codeql-action/upload-sarif@v3
39+
with:
40+
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)