gitleaks: v7.6.0 makes a 'could not generate Patch' error
Describe the bug When using the newest GitLeaks version (v7.6.0), I now am seeing a new error:
time="2021-09-08T15:37:19Z" level=info msg="opening ./\n"
time="2021-09-08T15:37:20Z" level=info msg="scan time: 1 second 67 milliseconds 150 microseconds"
time="2021-09-08T15:37:20Z" level=error msg="could not generate Patch"
Here’s the run with v7.6.0: https://github.com/emmahsax/emmahsax.github.io/runs/3546589868?check_suite_focus=true
Here’s the same run with v7.5.0: https://github.com/emmahsax/emmahsax.github.io/runs/3546602697?check_suite_focus=true
To get this, I’m running it with a --path='./' flag, and I’m passing in an additional config with a list of commits with the --commits flag.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Basic Info (please complete the following information):
- OS:
- Gitleaks Version:
Additional context Add any other context about the problem here.
cc @zricethezav
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 27 (16 by maintainers)
Commits related to this issue
- fix: Failures due to bug in `v7.6.1` => Downgrade While we look for a fix to this same bug and then jump to `v8`, this commit temporary downgrade Gitleaks action version as suggested by the author. ... — committed to motain/gitleaks-action by andreabenfatto 2 years ago
- fix: Failures due to bug in `v7.6.1` => Downgrade (#11) While we look for a fix to this same bug and then jump to `v8`, this commit temporary downgrade Gitleaks action version as suggested by the a... — committed to motain/gitleaks-action by andreabenfatto 2 years ago
@emmahsax, nothing more than we saw earlier.
--verbosedidn’t add details to the output.@cyrusmatsumori Maybe the
--verboseflag? It may give a little more than what you’ve got now?@w0rmr1d3r I’ve been unable to get it to trigger locally. However, @cyrusmatsumori and @ashokm may have been able to get it to consistently trigger locally.
I’ve found that if the commit is a pretty large one (like a
package-lock.jsonfile being committed/updated) this error occurs. Perhaps this problem is related to https://github.com/zricethezav/gitleaks/pull/414?@zricethezav I’m continuing to run into similar issues, but this time on GitLab CI:
I’ve tried removing the
/in the--path(same error), changing it from single-quotes to double-quotes (gitleaks ignored my commits because it couldn’t find the object, which implied the commits weren’t being interpolated correctly). I, again, think the path isn’t being set properly. Lastly, it’s again just an issue with>= v7.6.0, so version 7.5.0 continues to work as expected.