From 2db19f4c1430f7733d2de05c572d9082c46585b5 Mon Sep 17 00:00:00 2001 From: david ornelas Date: Thu, 5 Jun 2025 14:17:47 -0700 Subject: [PATCH] build: update prepush hook to add skip check option --- .husky/pre-push | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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