From 0550bb22a020ce724afdb8f0b1570fe145585ae2 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Sat, 30 Aug 2025 16:48:09 -0500 Subject: [PATCH] fix: make pre-commit hook work from any directory The pre-commit hook now uses git rev-parse --show-toplevel to find the repository root before navigating to the frontend directory. This ensures the hook works correctly whether it's run from the repo root or from within the frontend directory. This fixes the issue where Claude in GitHub Actions fails to commit because it starts in the frontend directory rather than the repo root. Fixes #223 --- .githooks/pre-commit | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index c807ffb0..ab83d490 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -2,8 +2,9 @@ echo "Running pre-commit hook..." -# Navigate to frontend directory -cd frontend || exit 1 +# Navigate to frontend directory from repo root +REPO_ROOT=$(git rev-parse --show-toplevel) +cd "$REPO_ROOT/frontend" || exit 1 # Check if bun is installed if ! command -v bun &> /dev/null; then