diff --git a/.husky/pre-commit b/.husky/pre-commit index 09dd6bf4f1..4d61930c9e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,8 @@ +branch="$(git rev-parse --abbrev-ref HEAD)" + +if [ "$branch" = "main" ]; then + echo "You can't push directly to main - please check out a branch." + exit 1 +fi + pnpx lint-staged diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 0000000000..8766e013b6 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,8 @@ +branch="$(git rev-parse --abbrev-ref HEAD)" + +if [ "$branch" = "main" ]; then + echo "You can't push directly to main - please check out a branch." + exit 1 +fi + +pnpm check-types