Skip to content

Commit fa4ebfd

Browse files
committed
fix(hooks): add -- to grep for private key pattern
1 parent 2f037d9 commit fa4ebfd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.git-hooks/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ while read local_ref local_sha remote_ref remote_sha; do
210210
fi
211211

212212
# Check for private keys.
213-
if echo "$file_text" | grep -qE '-----BEGIN (RSA |EC |DSA )?PRIVATE KEY-----'; then
213+
if echo "$file_text" | grep -qE -- '-----BEGIN (RSA |EC |DSA )?PRIVATE KEY-----'; then
214214
printf "${RED}✗ BLOCKED: Private key found in: %s${NC}\n" "$file"
215215
ERRORS=$((ERRORS + 1))
216216
fi

0 commit comments

Comments
 (0)