-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.21 KB
/
Copy pathpatchbrake-code-scanning.yml
File metadata and controls
50 lines (42 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: PatchBrake Code Scanning
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
security-events: write
jobs:
patchbrake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install PatchBrake
run: npm install -g patchbrake@0.2.0 --ignore-scripts
- name: Run PatchBrake SARIF scan
shell: bash
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "pull_request" ]; then
base="origin/${{ github.base_ref }}"
head="HEAD"
else
base="HEAD~1"
head="HEAD"
fi
patchbrake scan \
--base "$base" \
--head "$head" \
--format sarif \
--output patchbrake.sarif \
--fail-on never \
--no-custom-rules \
--disallow-inline-ignore \
--fail-on-new-ignore
- name: Upload PatchBrake SARIF
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: patchbrake.sarif