-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
Since version v8.21.3 (and confirmed in v8.23.3), when running the pre-commit hook with the following configuration, the hook fails with the following error when a single file is committed:
3:34PM ERR [git] fatal: cannot change to '.pre-commit-config.yaml': Not a directory
3:34PM ERR failed to scan Git repository error="stderr is not empty"
3:34PM WRN scanned ~0 bytes (0)
3:34PM WRN partial scan completed in 177ms
3:34PM WRN no leaks found in partial scanAnd this error with 2 or more files are commited:
3:36PM FTL accepts at most 1 arg(s), received 2
To Reproduce
Steps to reproduce the behavior:
.pre-commit-config.yaml
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.23.3
hooks:
- id: gitleaks-dockerpre-commit run -v
Expected behavior
The gitleaks-docker hook should run without error and scan the repository for hardcoded secrets. Ideally, it would ignore file arguments or be able to scan the repository as intended without trying to change directories into a file.
Screenshots
If applicable, add screenshots to help explain your problem.
Basic Info (please complete the following information):
- OS: Ubuntu 22.04
- Gitleaks Version: Docker version 8.23.3
Additional context
Add any other context about the problem here.
cc @zricethezav