security: privately collect redacted findings and log only paths/rules for 21-case triage
davoodmehraban89 committed
Oct 14, 2026 at 22:48 UTC
748489a00f07112e71f43b4ab2af0efca2184f2b
1 file changed
+12
-2
.github/workflows/security-secrets.yml
+12
-2
@@ -49,15 +49,25 @@ jobs:
49
with:
50
fetch-depth: 0
51
persist-credentials: false
52
- - name: Scan all reachable revisions with redacted output
52
+ - name: Scan full history; report location metadata only
53
shell: bash
54
run: |
55
set -euo pipefail
56
+ # Save the raw JSON only in the ephemeral runner directory. It is never
57
+ # uploaded, commented, or printed, even though Gitleaks redacts matches.
58
+ set +e
59
docker run --rm \
60
-v "$PWD:/repo:ro" \
61
+ -v "$RUNNER_TEMP:/audit" \
62
-w /repo \
63
-e GIT_CONFIG_COUNT=1 \
64
-e GIT_CONFIG_KEY_0=safe.directory \
65
-e GIT_CONFIG_VALUE_0=/repo \
66
ghcr.io/gitleaks/gitleaks:v8.24.3 \
63
- detect --source /repo --log-opts="--all" --redact --no-banner --exit-code=1
67
+ detect --source /repo --log-opts="--all" --redact --no-banner \
68
+ --report-format json --report-path /audit/gitleaks-redacted.json --exit-code=1
69
+ SCAN_STATUS=$?
70
+ set -e
71
+ node scripts/security/triage-gitleaks-report.mjs "$RUNNER_TEMP/gitleaks-redacted.json"
72
+ # Keep CI red if Gitleaks found something or encountered an error.
73
+ exit "$SCAN_STATUS"