awslabs / git-secrets

Prevents you from committing secrets and credentials into git repositories
Apache License 2.0
12.36k stars 1.17k forks source link

How to add this to existing hooks? #109

Open dashmug opened 5 years ago

dashmug commented 5 years ago

Can I run this as a script on top of my own git hooks? I'm using https://github.com/typicode/husky and it manages my git hooks for me. Basically I can configure husky to run any terminal command as a git hook.

andreasstieger commented 5 years ago

Yes, you should be able to deduce the required configuration for husky from: https://github.com/awslabs/git-secrets/blob/1.3.0/git-secrets#L195-L215

e.g. "pre-commit": "git secrets --prepare_commit_msg_hook [...]"