diff --git a/.husky/pre-push b/.husky/pre-push index d9b2545b59..5998ee38f4 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,10 +1,18 @@ #!/bin/sh [ -n "$CI" ] && exit 0 -echo "Running build and tests..." -yarn test && yarn build +# Check for skip checks via environment variable +# Usage: +# - Run with env var: SKIP_PUSH_HOOK=1 git push +if [ "$SKIP_PUSH_HOOK" = "1" ]; then + echo "Skipping build and tests..." + exit 0 +else + echo "Running build and tests..." + yarn test && yarn build -if [ $? -ne 0 ]; then - echo "Build or tests failed. Please fix errors before pushing." - exit 1 + if [ $? -ne 0 ]; then + echo "Build or tests failed. Please fix errors before pushing or use 'SKIP_PUSH_HOOK=1 git push' to skip." + exit 1 + fi fi