From bf43e600dfc258f3c12b379543e4a25b0d77a900 Mon Sep 17 00:00:00 2001 From: dhandsar-aws Date: Fri, 11 Feb 2022 13:46:24 -0800 Subject: [PATCH] feat: add git secrets check and scan --- .husky/pre-commit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index ac56997df..589c5dd60 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -8,4 +8,10 @@ fi . "$(dirname "$0")/_/husky.sh" +if [ `git config --get-all secrets.patterns | wc -l` == 0 ]; then + echo "Git secrets are not configured. To configure please follow instructions here: https://github.com/awslabs/git-secrets." + exit 1 +fi + npx --no-install lint-staged +git-secrets --scan