-
Notifications
You must be signed in to change notification settings - Fork 241
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
bug: talisman allows push when user adds a commit to delete the added secret #16
Comments
Shouldn't talisman be a pre-commit hook instead of a pre-push hook? |
It works with the latest Talisman. Tested. @jacksingleton Please test and close the ticket if it looks ok |
Closing this ticket, due to no further feedback. Please do let us know if you would like to re-open this. |
Sorry, closed in error. This issue is actually still reproducible. Re-opening. This is because on pre-push hook, talisman checks the complete file, and not the diff |
I just stumbled on this bug as well 😅 I think this behavior should be highlighted in https://github.com/thoughtworks/talisman#talisman-in-action to prevent anyone from getting bitten by this. It is mentioned that a pre-commit hook is preferred but its not clear why.
Especially ...as a pre-push hook, it will scan the complete file in which changes are made. What's happening is that the pre-push hook will get the filenames of files that were added, copied or modified via Here is the path in the code:
This is pretty confusing as there are at least 3 different scanning behaviors I can find. The Hope this helps the person picking this up :) |
touch secret.pem
git commit -am "whoops"
git push
talisman: booo
rm secret.pem
git commit -am "all safe now"
git push
talisman: 👍
The text was updated successfully, but these errors were encountered: