We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ba74108 + 191c7dc commit f451998Copy full SHA for f451998
1 file changed
.pre-commit-config.yaml
@@ -44,3 +44,12 @@ repos:
44
rev: v8.24.2
45
hooks:
46
- id: gitleaks
47
+ # Override upstream `gitleaks git --pre-commit --staged`, which scans
48
+ # staged git diffs and is a no-op in CI (`pre-commit run --all-files`
49
+ # has nothing staged). Instead, scan the files pre-commit passes in:
50
+ # staged files on `git commit`, tracked files on `--all-files`.
51
+ # `gitleaks dir` only accepts one path per invocation, so fan out via
52
+ # xargs -P for parallelism; xargs returns 123 if any child exits
53
+ # non-zero, which pre-commit surfaces as a hook failure.
54
+ entry: sh -c 'printf "%s\0" "$@" | xargs -0 -n1 -P"$(getconf _NPROCESSORS_ONLN)" gitleaks dir --redact --verbose --no-banner' --
55
+ pass_filenames: true
0 commit comments