fix(hooks): prevent git pre-push stdin from executing in CI container\n\n- Redirect stdin to /dev/null for docker compose run in scripts/ci\n- Fixes errors like 'bash: refs/tags/<tag>: No such file or directory'\n

This commit is contained in:
2025-09-10 16:51:51 -05:00
parent 9cb1f5da1f
commit 9fb481dad9

View File

@@ -29,9 +29,11 @@ run_outside_container() {
exit 1 exit 1
fi fi
# Build ci image if needed and run the requested phase inside the container # Build ci image if needed and run the requested phase inside the container
# Important: detach stdin so git hook-provided stdin (ref updates)
# doesn't get executed inside the container shell.
(cd "$root" && docker compose -f docker/ci.compose.yml run --rm \ (cd "$root" && docker compose -f docker/ci.compose.yml run --rm \
-e IN_CI_CONTAINER=1 \ -e IN_CI_CONTAINER=1 \
ci bash -lc "cd /workspace && scripts/ci --inside ${phase}") ci bash -lc "cd /workspace && scripts/ci --inside ${phase}" </dev/null)
} }
run_format() { run_format() {
@@ -112,4 +114,3 @@ if [[ "${IN_CI_CONTAINER:-}" != "1" ]]; then
else else
run_inside_container "$PHASE" run_inside_container "$PHASE"
fi fi