forked from avivsinai/bitbucket-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.12 KB
/
gitleaks.yml
File metadata and controls
45 lines (39 loc) · 1.12 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
name: Gitleaks
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
security-events: write # For uploading SARIF results
actions: read
jobs:
gitleaks:
name: Scan for secrets
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Run Gitleaks
id: gitleaks
uses: DariuszPorowski/github-action-gitleaks@v2
with:
config: .gitleaks.toml
report_format: sarif
fail: false # Don't fail workflow, upload results instead
log_level: info
- name: Upload SARIF to GitHub Code Scanning
if: steps.gitleaks.outputs.exitcode == 1
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: ${{ steps.gitleaks.outputs.report }}
- name: Fail if secrets found
if: steps.gitleaks.outputs.exitcode == 1
run: |
echo "::error::Gitleaks detected secrets in the codebase"
exit 1