0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00

chore(dev): Add pre-push hook to confirm pushing to master (#22490)

* chore(dev): Add pre-push hook to confirm pushing to master

* Prohibit direct pushes completely
This commit is contained in:
Michael Matloka 2024-05-24 12:57:54 +02:00 committed by GitHub
parent 77c0c9f4d6
commit 4f2cac2668
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

13
.husky/pre-push Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
protected_branch='master'
current_branch=$(git branch --show-current)
if [ $protected_branch = $current_branch ]
then
echo "Pushing to $protected_branch is a sin! Instead, create a pull request and repent."
exit 1 # push will not execute
else
exit 0 # push will execute
fi