Skip to content

Commit daf2624

Browse files
authored
Merge pull request #2 from specklesystems/iain/add-ggshield-not-ci-pre-commit-hook
Adds a pre-commit hook for ggshield not in a CI environment
2 parents 58832ab + 1d417e6 commit daf2624

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.pre-commit-hooks.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- id: ggshield-not-ci
2+
name: GitGuardian Shield (pre-commit)
3+
description: Runs ggshield in non-CI environments to detect hardcoded secrets, security vulnerabilities and policy breaks.
4+
stages: [commit]
5+
entry: hooks/ggshield-not-ci.sh
6+
language: script

hooks/ggshield-not-ci.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -eo pipefail
3+
4+
if [[ ! -z "${CI}"} ]]; then
5+
ggshield secret scan pre-commit
6+
fi

0 commit comments

Comments
 (0)