Skip to content

fix: nightly 规划器兼容 git worktree 检出 - #101

Merged
IchenDEV merged 1 commit into
mainfrom
agent/qa/nightly-plan-worktree-fix
Sep 18, 2026
Merged

IchenDEV merged 1 commit into
mainfrom
agent/qa/nightly-plan-worktree-fix

Conversation

@IchenDEV

Copy link
Copy Markdown
Owner

背景

验证合入后的 nightly 规划器时发现在本工作区(git worktree,.git 是文件不是目录)会误判为「不是 git 仓库」。CI 用 actions/checkout 是普通 clone,不受影响,但本地 workflow_dispatch 之外的调试、以及任何 worktree 检出都会被挡住,属于该脚本的可用性缺陷。

改动

scripts/nightly-release-plan.sh:仓库校验从 [ -d "$REPOSITORY/.git" ] 改为 git -C "$REPOSITORY" rev-parse --git-dir,兼容普通 clone 与 worktree/submodule;真正的非仓库(临时目录、普通文件夹)仍然 fail closed。

验证

  • 合并后的 main(2ece2d7)上实跑规划器:识别 worktree 正常,输出
    changed=true version=0.0.47 latest_tag=v0.0.46 commit_count=2,说明今晚 20:00 会从 v0.0.46 递增到 v0.0.47。
  • bash scripts/tests/test_nightly_release_plan.sh → passed(含「非仓库必须失败」用例外,mktemp 目录仍被拒绝)
  • bash scripts/tests/test_release_version.sh → passed
  • bash scripts/ci-basic-checks.sh → "Basic CI checks passed."

范围

1 个文件、3 行改动;不改工作流、不改发布语义。建议在今晚第一次定时运行前合入(不阻塞定时;即使未合,CI 的普通 clone 也不受影响)。

The planner rejected any repository whose .git is a file rather than a directory, which is how git worktrees represent themselves. Ask git itself via rev-parse --git-dir so worktree checkouts (and the actions/checkout style) are accepted, and keep failing closed for genuine non-repositories.

Co-authored-by: multica-agent <github@multica.ai>
@IchenDEV
IchenDEV merged commit 868f228 into main Sep 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant