Skip to content

Commit a3fcc7b

Browse files
committed
Fix OSV-Scanner workflow to use reusable workflows
Split into PR scan and scheduled scan workflows using the official google/osv-scanner-action reusable workflow pattern.
1 parent bb5f82e commit a3fcc7b

2 files changed

Lines changed: 21 additions & 22 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: OSV-Scanner Scheduled Scan
2+
3+
on:
4+
schedule:
5+
- cron: '0 6 * * 1' # Weekly Monday 6am UTC
6+
push:
7+
branches: [main]
8+
9+
permissions:
10+
actions: read
11+
contents: read
12+
security-events: write
13+
14+
jobs:
15+
scan-scheduled:
16+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.3.3"

.github/workflows/osv-scanner.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
1-
name: OSV-Scanner Vulnerability Scan
1+
name: OSV-Scanner PR Scan
22

33
on:
44
pull_request:
55
branches: [main]
6-
push:
6+
merge_group:
77
branches: [main]
8-
schedule:
9-
- cron: '0 6 * * 1' # Weekly Monday 6am UTC
10-
workflow_dispatch:
118

129
permissions:
10+
actions: read
1311
contents: read
1412
security-events: write
1513

1614
jobs:
17-
osv-scan:
18-
runs-on: ubuntu-latest
19-
steps:
20-
- uses: actions/checkout@v4
21-
22-
- name: Run OSV-Scanner
23-
uses: google/osv-scanner-action/osv-scanner-action@v2
24-
with:
25-
scan-args: |-
26-
--recursive
27-
./
28-
29-
- name: Upload SARIF
30-
if: always()
31-
uses: github/codeql-action/upload-sarif@v3
32-
with:
33-
sarif_file: results.sarif
15+
scan-pr:
16+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@v2.3.3"

0 commit comments

Comments
 (0)