Skip to content

Commit 9692cd9

Browse files
Add Gitleaks SARIF workflow
1 parent bc142b8 commit 9692cd9

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/gitleaks.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: gitleaks
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 4 * * *"
8+
9+
jobs:
10+
scan:
11+
name: gitleaks
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
contents: read
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Install gitleaks
22+
run: |
23+
curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.18.4/gitleaks_8.18.4_linux_x64.tar.gz \
24+
| tar -xz -C /usr/local/bin gitleaks
25+
chmod +x /usr/local/bin/gitleaks
26+
27+
- name: Run gitleaks and output SARIF
28+
env:
29+
GITLEAKS_DISABLE_TELEMETRY: "true"
30+
run: |
31+
mkdir -p reports
32+
gitleaks detect --source . --report-format sarif --report-path reports/gitleaks.sarif || true
33+
34+
- name: Upload SARIF results
35+
uses: github/codeql-action/upload-sarif@v3
36+
with:
37+
sarif_file: reports/gitleaks.sarif

0 commit comments

Comments
 (0)