Skip to content

Commit

Permalink
feat: add git secrets check and scan (#402)
Browse files Browse the repository at this point in the history
Adding git secrets check and enabling scan to prevent from committing passwords and other sensitive information to a git repository.
  • Loading branch information
dhandsar-aws authored Feb 11, 2022
1 parent ed5aaf1 commit b8e6237
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b8e6237

Please sign in to comment.