Skip to content

Gitleaks Secret Scan #445

Gitleaks Secret Scan

Gitleaks Secret Scan #445

Workflow file for this run

name: Gitleaks Secret Scan
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "0 2 * * 1"
permissions:
contents: read
security-events: write
jobs:
gitleaks:
name: Detect Secrets with Gitleaks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Run Gitleaks
uses: zricethezav/gitleaks-action@v2
continue-on-error: true
with:
args: detect --source . --report-format sarif --report-path gitleaks.sarif
- name: Ensure SARIF file exists
run: |
if [ ! -f gitleaks.sarif ] || [ ! -s gitleaks.sarif ]; then
cat > gitleaks.sarif <<'EOF'
{
"version": "2.1.0",
"runs": [
{
"tool": {
"driver": {
"name": "gitleaks",
"informationUri": "https://github.com/zricethezav/gitleaks",
"rules": []
}
},
"results": []
}
]
}
EOF
fi
- name: Debug SARIF output
run: cat gitleaks.sarif
- name: Upload SARIF report
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: gitleaks.sarif
category: gitleaks