From 359c84e855a38843257508da4dcf6637c2d5f2a0 Mon Sep 17 00:00:00 2001 From: cte Date: Sun, 11 May 2025 23:40:05 -0700 Subject: [PATCH] Add pre-push type check --- .husky/pre-commit | 7 +++++++ .husky/pre-push | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 .husky/pre-push 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