Skip to content

Commit a8d6aff

Browse files
committed
test: forcing failure with a ghp token pattern
1 parent e44cd66 commit a8d6aff

1 file changed

Lines changed: 32 additions & 8 deletions

File tree

.github/workflows/security.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,36 @@
1-
name: Gitleaks
2-
on: [push, pull_request]
3-
1+
on:
2+
pull_request:
3+
branches: [main]
4+
push:
5+
branches: [main]
6+
47
jobs:
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

0 commit comments

Comments
 (0)