From 3eee340aa37297c09d69a4a3b840ae50d2941610 Mon Sep 17 00:00:00 2001 From: Daniel <57051444+daniel-lxs@users.noreply.github.com> Date: Wed, 5 Nov 2025 12:06:22 -0500 Subject: [PATCH] feat: add conditional test running to pre-push hook (#9055) --- .husky/pre-push | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.husky/pre-push b/.husky/pre-push index 3c206835b7..9e41e80cf8 100644 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -18,6 +18,16 @@ fi $pnpm_cmd run check-types +# Load .env.local if it exists +if [ -f ".env.local" ]; then + export $(grep -v '^#' .env.local | xargs) +fi + +# Run tests if RUN_TESTS_ON_PUSH is set to true +if [ "$RUN_TESTS_ON_PUSH" = "true" ]; then + $pnpm_cmd run test +fi + # Check for new changesets. NEW_CHANGESETS=$(find .changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ') echo "Changeset files: $NEW_CHANGESETS"