Skip to content

Commit

Permalink
Gitguardian pre commit hook (#8458)
Browse files Browse the repository at this point in the history
* Add gitguardian precommit hook

* installation check
  • Loading branch information
tdraier authored Nov 5, 2024
1 parent 4c5ede1 commit a719eb0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ if [ "$current_branch" = "main" ]; then
fi
fi

if [ -z "$ENABLE_GGSHIELD_ON_COMMIT" ]
then
echo "You can enable secret check by setting ENABLE_GGSHIELD_ON_COMMIT and installing ggshield"
else
if command -v ggshield 2>&1 >/dev/null; then
ggshield secret scan pre-commit "$@"
else
echo "ggshield is not installed. Please install ggshield to enable secret check"
fi
fi

# If env var DUST_LINT_ON_COMMIT = 1, run the linter
if [ -z "$DUST_LINT_ON_COMMIT" ]; then
echo "Please set DUST_LINT_ON_COMMIT if you want to locally run the lint, type check etc.. before committing."
Expand Down

0 comments on commit a719eb0

Please sign in to comment.