File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Gitleaks
2- on : [push, pull_request]
3-
1+ on :
2+ pull_request :
3+ branches : [main]
4+ push :
5+ branches : [main]
6+
47jobs :
5- scan :
8+ secret-scan :
9+ name : Scan for secrets
610 runs-on : ubuntu-latest
11+ permissions :
12+ contents : read
13+ security-events : write
714 steps :
8- - uses : actions/checkout@v4
15+ - name : Checkout code
16+ uses : actions/checkout@v4
917 with :
10- fetch-depth : 0 # look at history, not just the latest commit
11-
12- - uses : gitleaks/gitleaks-action@v2
18+ fetch-depth : 0 # secrets can hide in old commits
19+
20+ - name : Run Gitleaks
21+ uses : gitleaks/gitleaks-action@v2
22+ env :
23+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24+ with :
25+ args : >-
26+ --redact
27+ --report-format sarif
28+ --report-path gitleaks-results.sarif
29+ --exit-code 1
30+
31+ - name : Upload SARIF to GitHub Security tab
32+ if : always()
33+ uses : github/codeql-action/upload-sarif@v3
34+ with :
35+ sarif_file : gitleaks-results.sarif
36+ category : secret-scanning
You can’t perform that action at this time.
0 commit comments