Skip to content

Commit 4477ad3

Browse files
authored
OSV-scanner on PR check
1 parent 84fbab8 commit 4477ad3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/gradle.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: OSV-Scanner (PR Check)
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
osv-scan:
9+
name: Scan for New Vulnerabilities
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
security-events: write # Required to upload results to GitHub Security tab
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Important: Fetch full history for diff comparison
21+
22+
- name: Run OSV-Scanner
23+
uses: google/osv-scanner-action@v1
24+
with:
25+
# This specific config enables the "Diff" logic from your diagram
26+
scan-args: |-
27+
--recursive
28+
--format=sarif
29+
--output=results.sarif
30+
31+
# Optional: If you want to block the PR on new findings
32+
fail-on-vuln: true
33+
34+
- name: Upload SARIF results
35+
uses: github/codeql-action/upload-sarif@v3
36+
if: always() # Upload results even if the scan fails
37+
with:
38+
sarif_file: results.sarif

0 commit comments

Comments
 (0)