Skip to content

Commit 369c21b

Browse files
committed
udpate git secrets hook
1 parent 83e8b11 commit 369c21b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ dist
1111
!.env.example
1212
!.env.sample
1313

14+
.husky/.git-secrets-installed
15+
1416
TODO
1517

1618
tmp

.husky/pre-commit

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,22 @@ then
44
exit 1
55
fi
66

7-
git-secrets --register-aws > /dev/null
7+
8+
HOOK_FLAG=".husky/.git-secrets-installed"
9+
if [[ ! -f "$HOOK_FLAG" ]]; then
10+
git-secrets --register-aws > /dev/null
11+
git secrets --add -- 'ghp_[A-Za-z0-9_]\{36\}'
12+
git secrets --add -- 'github_pat_[A-Za-z0-9_]\{36\}'
13+
git secrets --add -- 'xox[apb]-[0-9]\{12\}-[0-9]\{12\}-[A-Za-z0-9]\{24\}'
14+
git secrets --add -- 'sk_live_[A-Za-z0-9]\{24\}'
15+
git secrets --add -- 'pk_live_[A-Za-z0-9]\{24\}'
16+
git secrets --add -- 'AIza[0-9A-Za-z_-]\{35\}'
17+
git secrets --add -- '^[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}$'
18+
git secrets --add -- '[A-Za-z0-9_-]\{20,\}\.[A-Za-z0-9_-]\{20,\}\.[A-Za-z0-9_-]\{20,\}'
19+
git secrets --add -- 'postgres:\/\/[A-Za-z0-9@:\-_.\/?%=+]+'
20+
git secrets --add -- 'BEGIN'
21+
touch "$HOOK_FLAG"
22+
fi
823

924
echo "🔍 Running git-secrets..."
1025
git-secrets --pre_commit_hook -- "$@"

0 commit comments

Comments
 (0)