diff --git a/Dockerfile.cicd b/Dockerfile.cicd index a146cfb..9e1b447 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -178,15 +178,17 @@ RUN echo "=== Installing Backend Package in Development Mode ===" && \ WORKDIR /workspace RUN echo "=== Installing Pre-commit Hook Environments ===" && \ if [ -f ".pre-commit-config.yaml" ]; then \ - # pre-commit expects a git repository; create a temporary one for CI image prewarming. - git init /workspace >/dev/null 2>&1 || true && \ - cd backend && \ + # pre-commit requires a git repo at runtime; keep it in the final image. + git config --global user.email "ci@cicd" && \ + git config --global user.name "CICD" && \ + git init /workspace && \ + git -C /workspace add -A && \ + cd /workspace/backend && \ if uv run pre-commit install-hooks; then \ echo "✓ Pre-commit hook environments installed successfully"; \ else \ echo "⚠ pre-commit hook prewarming failed; continuing"; \ - fi && \ - rm -rf /workspace/.git; \ + fi; \ else \ echo "No .pre-commit-config.yaml found, skipping hook installation"; \ fi