Files
gplan-2/tools/hooks/post-commit
T

12 lines
606 B
Bash

#!/usr/bin/env bash
# 红态追绿钩子(本地 CI 触发钩子,2026-10-30 用户裁)——仅当最近一次 CI 判红时,本提交触发
# 后台复验(tools/ci_runner.sh commit,判定在跑批件内);绿态与无状态零触发——
# 小批直提不重复跑全量,同一份字节禁止第二次人手跑。主工作区限定。
set -u
_GD="$(cd "$(git rev-parse --git-dir)" && pwd)"
_CD="$(cd "$(git rev-parse --git-common-dir)" && pwd)"
[ "$_GD" = "$_CD" ] || exit 0
REPO="$(git rev-parse --show-toplevel)"
( nohup bash "$REPO/tools/ci_runner.sh" commit >/dev/null 2>&1 & )
exit 0