mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-11-03 00:53:53 +00:00
19 lines
428 B
Bash
Executable File
19 lines
428 B
Bash
Executable File
#!/bin/sh
|
|
. "$(dirname "$0")/_/husky.sh"
|
|
|
|
# Skip protection if running in GitHub Actions
|
|
if [ "$GITHUB_ACTIONS" = "true" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
protected_branch='main'
|
|
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
|