diff --git a/.husky/pre-commit b/.husky/pre-commit index bae616c39..d8fae09fc 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,8 @@ +branch="$(git rev-parse --abbrev-ref HEAD)" + +if [ "$branch" = "master" ] || [ "$branch" = "main" ]; then + echo "❌ You can't commit directly to $branch" + exit 1 +fi + yarn dlx lint-staged diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 000000000..0e2cd551e --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,6 @@ +branch="$(git rev-parse --abbrev-ref HEAD)" + +if [ "$branch" = "master" ] || [ "$branch" = "main" ]; then + echo "❌ You can't push directly to $branch" + exit 1 +fi