From 523b49b3191ff2fa44ae018712f6b4464ce4f882 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Mon, 2 Nov 2026 17:06:11 +0530 Subject: [PATCH] chore: add ggshield secret scan to husky pre-commit and pre-push hooks Standard block from the Secrets Scanning (ggshield) setup, section 6.1. Co-Authored-By: Claude Sonnet 5.5 --- .husky/pre-commit | 10 ++++++++++ .husky/pre-push | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index da3763f..a209c95 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,14 @@ #!/usr/bin/env sh +# >>> GitGuardian secret scan (managed by Contentstack Security) >>> +if [ -z "${CI:-}" ]; then + if ! command -v ggshield >/dev/null 2>&1; then + echo "ggshield is not installed - secret scanning is required. Setup: https://contentstack.atlassian.net/wiki/x/FIDVEwE" >&2 + exit 1 + fi + ggshield secret scan pre-commit || exit 1 +fi +# <<< GitGuardian secret scan <<< + # Pre-commit hook to run Talisman and Snyk scans, completing both before deciding to commit # Function to check if a command exists diff --git a/.husky/pre-push b/.husky/pre-push index 9ed9517..e6689bd 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,14 @@ #!/usr/bin/env sh +# >>> GitGuardian secret scan (managed by Contentstack Security) >>> +if [ -z "${CI:-}" ]; then + if ! command -v ggshield >/dev/null 2>&1; then + echo "ggshield is not installed - secret scanning is required. Setup: https://contentstack.atlassian.net/wiki/x/FIDVEwE" >&2 + exit 1 + fi + ggshield secret scan pre-push "$@" || exit 1 +fi +# <<< GitGuardian secret scan <<< + echo "🚀 Running pre-push checks..."