Skip to content

Commit e418dfb

Browse files
dautovriOhmSpectator
authored andcommitted
Add OSV-Scanner GitHub Actions workflow for vulnerability scanning
This pull request introduces a new GitHub Actions workflow to integrate OSV-Scanner for security scanning. The workflow is configured to run on pull requests, scheduled events, and pushes to the master branch. Key changes: .github/workflows/osv-scanner.yml: Added a new workflow file to configure OSV-Scanner for security scanning on pull requests, scheduled events, and pushes to the master branch. The workflow includes permissions setup and job definitions for both scheduled scans and pull request scans. Signed-off-by: Ruslan Dautov <dautov2@gmail.com>
1 parent 54304ff commit e418dfb

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/osv-scanner.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
# Copyright (c) 2025, Zededa, Inc.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: OSV-Scanner
6+
7+
on: # yamllint disable-line rule:truthy
8+
push:
9+
branches:
10+
- "master"
11+
- "[0-9]+.[0-9]+"
12+
- "[0-9]+.[0-9]+-stable"
13+
paths-ignore:
14+
- '**/*.md'
15+
- '.github/**'
16+
pull_request:
17+
# The branches below must be a subset of the branches above
18+
branches:
19+
- "master"
20+
- "[0-9]+.[0-9]+"
21+
- "[0-9]+.[0-9]+-stable"
22+
paths-ignore:
23+
- '**/*.md'
24+
schedule:
25+
- cron: "12 12 * * 1"
26+
27+
permissions:
28+
# Required to upload SARIF file to CodeQL. See: https://github.com/github/codeql-action/issues/2117
29+
actions: read
30+
# Require writing security events to upload SARIF file to security tab
31+
security-events: write
32+
# Read commit contents
33+
contents: read
34+
35+
jobs:
36+
scan-scheduled:
37+
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
38+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@e994fd8ab13fe1394942045f5945cd39c6c2d68e" # v1.9.2
39+
40+
scan-pr:
41+
if: ${{ github.event_name == 'pull_request'}}
42+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@e994fd8ab13fe1394942045f5945cd39c6c2d68e" # v1.9.2

0 commit comments

Comments
 (0)