We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6616597 commit 7c41c37Copy full SHA for 7c41c37
1 file changed
bin/pre-commit
@@ -19,10 +19,10 @@ if [ -n "$staged_files" ]; then
19
fi
20
21
22
-# Check for secrets/env files
23
-if echo "$staged_files" | grep -q '\.env$\|\.env\.\|master\.key'; then
+# Check for secrets/env files (allow .env.example)
+if echo "$staged_files" | grep '\.env$\|\.env\.\|master\.key' | grep -qv '\.env\.example$'; then
24
echo "ERROR: Potentially sensitive files staged for commit:"
25
- echo "$staged_files" | grep '\.env$\|\.env\.\|master\.key'
+ echo "$staged_files" | grep '\.env$\|\.env\.\|master\.key' | grep -v '\.env\.example$'
26
echo "Remove them from staging before committing."
27
exit 1
28
0 commit comments