fancive_obsidian-parallel-r.../.e2e/hook.sh
wujunchen 970a7bc364 chore: add e2e contract gate
Change-Id: Idf5c36b17a5b816e354d07f1e28ff4011e54f32e
2026-04-29 14:08:38 +08:00

22 lines
361 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
[ "${STOP_HOOK_ACTIVE:-}" = "true" ] && exit 0
export STOP_HOOK_ACTIVE=true
OUT="$(mktemp)"
set +e
bash .e2e/gate.sh --json >"$OUT"
CODE=$?
set -e
if [ "$CODE" -ne 0 ]; then
cat "$OUT" >&2
rm -f "$OUT"
echo '{"decision":"block","reason":"e2e contract gate failed"}'
exit 2
fi
cat "$OUT" >&2
rm -f "$OUT"
exit 0