-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gitleaks returns exit code 0 when a sequence of invalid flags is passed #1464
Comments
I think this should be fixed by #1461. $ ./gitleaks detect -s --no-banner . -c config.toml
○
│╲
│ ○
○ ░
░ gitleaks
11:14PM ERR [git] fatal: cannot change to '--no-banner': No such file or directory
11:14PM ERR failed to scan Git repository error="stderr is not empty"
11:14PM WRN partial scan completed in 3.72ms
11:14PM WRN no leaks found in partial scan
$ echo $?
1 |
This still exists @rgmz
I think this is because the error is only logged instead of terminating with exit code 1: Lines 117 to 120 in c5b15c9
With the replacement of
What is the purpose to only log this error? |
Hmm, must be a regression from #1504. |
Just have seen the deprecation comments, wasn't aware of this change tbh. However executing the same flags with
|
Describe the bug
Gitleaks returns exit code 0 when the order of the flags should have caused it to fail (and return exit code 1).
To Reproduce
Steps to reproduce the behavior:
touch config.toml
gitleaks detect -s --no-banner . -c config.toml
echo $?
(0 is returned, despite the output showing the error)Expected behavior
Return exit code 1 (leaks or error encountered).
Screenshots
n/a
Basic Info (please complete the following information):
Additional context
Not passing the config file flag (i.e.,
gitleaks detect -s --no-banner .
) returns the expected exit code (1).I ran into this by chance due to having misplaced the arguments, other flag combinations possibly have the same behavior.
cc @zricethezav
The text was updated successfully, but these errors were encountered: