ci / test (pull_request) Failing after 1m37s
Why: the hook landed as 100644, so `make setup` chmod left a mode-only diff that makes the main checkout permanently dirty and blocks task.sh close (dirty-tree guard). Evidence: git status showed " M scripts/hooks/post-merge" with 0 insertions/deletions after make setup; task-finish tail reported the dirty-tree refusal. Impact: mode 100644 -> 100755 only; no content change. Refs: task card feature/card-autoclose-r1 (PR #16 follow-up)
16 lines
995 B
Bash
Executable File
16 lines
995 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# 本地钩子(post-merge):merge 型 pull/merge 落地后自动闭合已合入任务卡(ff-only 不触发
|
|
# 本钩子——由 task-finish 收尾与 precheck [cards] 报告兜底)。
|
|
# 触发条件收紧到"主检出 + 集成分支 main"——任务 worktree 里 task-sync 的 merge 不触发,
|
|
# 防止把卡片闭合混进任务分支现场。失败只警告,绝不阻断 pull。
|
|
# 注意:task.sh close 在主检出会另建 feature/card-close-* 分支提交(集成分支不直推),
|
|
# 结束后切回 main;PR 由所有者合入。
|
|
common=$(git rev-parse --git-common-dir) && common=$(cd "$common" 2>/dev/null && pwd) || exit 0
|
|
mainrepo=$(dirname "$common")
|
|
[ "$mainrepo" = "$PWD" ] || exit 0
|
|
[ "$(git rev-parse --abbrev-ref HEAD)" = "main" ] || exit 0
|
|
[ -f "$mainrepo/scripts/task.sh" ] || exit 0
|
|
bash "$mainrepo/scripts/task.sh" close \
|
|
|| echo "[warn] post-merge 卡片自动闭合失败——在主检出手动运行 make task-close" >&2
|
|
exit 0
|