fix: nightly 规划器兼容 git worktree 检出 - #101
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
验证合入后的 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→ passedbash scripts/ci-basic-checks.sh→ "Basic CI checks passed."范围
1 个文件、3 行改动;不改工作流、不改发布语义。建议在今晚第一次定时运行前合入(不阻塞定时;即使未合,CI 的普通 clone 也不受影响)。