mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 08:40:03 +01:00
4f2cac2668
* chore(dev): Add pre-push hook to confirm pushing to master * Prohibit direct pushes completely
14 lines
328 B
Bash
Executable File
14 lines
328 B
Bash
Executable File
#!/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
|