diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..965b1ec --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,6 @@ +- id: ggshield-not-ci + name: GitGuardian Shield (pre-commit) + description: Runs ggshield in non-CI environments to detect hardcoded secrets, security vulnerabilities and policy breaks. + stages: [commit] + entry: hooks/ggshield-not-ci.sh + language: script diff --git a/hooks/ggshield-not-ci.sh b/hooks/ggshield-not-ci.sh new file mode 100755 index 0000000..cafb800 --- /dev/null +++ b/hooks/ggshield-not-ci.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -eo pipefail + +if [[ ! -z "${CI}"} ]]; then + ggshield secret scan pre-commit +fi