Skip to content

Commit 3eee340

Browse files
authored
feat: add conditional test running to pre-push hook (#9055)
1 parent e86acef commit 3eee340

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.husky/pre-push

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ fi
1818

1919
$pnpm_cmd run check-types
2020

21+
# Load .env.local if it exists
22+
if [ -f ".env.local" ]; then
23+
export $(grep -v '^#' .env.local | xargs)
24+
fi
25+
26+
# Run tests if RUN_TESTS_ON_PUSH is set to true
27+
if [ "$RUN_TESTS_ON_PUSH" = "true" ]; then
28+
$pnpm_cmd run test
29+
fi
30+
2131
# Check for new changesets.
2232
NEW_CHANGESETS=$(find .changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ')
2333
echo "Changeset files: $NEW_CHANGESETS"

0 commit comments

Comments
 (0)