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 : secret-scan
2+ # Detects committed secrets with the gitleaks BINARY (free; no org license needed — the gitleaks Action
3+ # requires a paid license for organizations, the binary does not). --redact guarantees no secret VALUE is ever
4+ # printed in logs. Added by the compliance hardening pass as the plan-independent substitute for GitHub's
5+ # native secret scanning, which is a paid add-on on private repos. A failing run means a real secret is
6+ # committed: rotate it and purge it from history.
7+ on :
8+ pull_request :
9+ push :
10+ branches : ["main"]
11+ schedule :
12+ - cron : " 0 6 * * 1"
13+ workflow_dispatch :
14+ permissions :
15+ contents : read
16+ jobs :
17+ gitleaks :
18+ runs-on : ubuntu-latest
19+ steps :
20+ - uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0
23+ - name : Run gitleaks (redacted)
24+ run : |
25+ set -euo pipefail
26+ ver="$(curl -sSL https://api.github.com/repos/gitleaks/gitleaks/releases/latest \
27+ | grep -oP '"tag_name": *"v\K[^"]+')"
28+ curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${ver}/gitleaks_${ver}_linux_x64.tar.gz" \
29+ | tar -xz gitleaks
30+ ./gitleaks detect --source . --redact --no-banner --exit-code 1
You can’t perform that action at this time.
0 commit comments