Skip to content

fix(release): drop detached-HEAD version-commit step#51

Merged
Shadow-Azure merged 1 commit into
mainfrom
fix/release-detached-head
Jul 19, 2026
Merged

fix(release): drop detached-HEAD version-commit step#51
Shadow-Azure merged 1 commit into
mainfrom
fix/release-detached-head

Conversation

@Shadow-Azure

Copy link
Copy Markdown
Owner

Problem

Every release.yml run since v0.3.0 has ended with the macOS job red, even though the release actually succeeds. The failing step is "Commit version changes":

fatal: You are not currently on a branch.
##[error]Process completed with exit code 128.

Root cause: on a release event the workflow checks out the tag (github.ref = refs/tags/vX.Y.Z) → detached HEAD. The step then runs git push to commit the CI-rewritten packages/*/package.json versions back to main, which is impossible from a detached HEAD. Confirmed red on v0.3.0 and v0.4.0 (initial run + re-runs).

Purely cosmetic — build / asset upload / npm publish all run before it and succeed — but it makes every release run look broken and masks real failures.

Solution

Delete the "Commit version changes" step entirely.

release/release-pipeline.md § Version Management already states that packages/*/package.json versions lagging the published npm versions is "expected and harmless" — CI rewrites them at publish time from the git tag. Committing them back to main is unnecessary, so removing the step lets the macOS job go green on release.

Test Plan

  • ruby -ryaml confirms the file is still valid YAML
  • Both jobs (build-and-release, build-linux) intact; Publish npm packages is now the last macOS step; Commit version changes gone
  • CI Gate passes on this PR
  • Definitive verification on the next release (v0.4.1+): macOS job fully green, npm publish still succeeds

🤖 Generated with Claude Code

The "Commit version changes" step ran `git push` after checking out the
release tag, which is a detached HEAD — so it failed every release with
`fatal: You are not currently on a branch.` (exit 128). This made the
macOS job red on every release even though build, asset upload, and npm
publish all succeeded before it.

Remove the step. release-pipeline.md already states that
packages/*/package.json versions lagging the published npm versions is
"expected and harmless" — CI rewrites them at publish time from the tag,
so committing them back to main is unnecessary (and impossible from a
detached HEAD anyway).

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔒 门禁检查结果

检查项 状态
Rust 格式化 ✅ success
Rust Clippy ✅ success
Rust 测试 & 覆盖率 ✅ success
前端测试 & 覆盖率 ✅ success
Playwright E2E ✅ success
统一测试 (test.sh) ✅ success
安全检查 ✅ success
发布模拟验证 ✅ success
升级流程测试 ✅ success
cli-box-skill 单元测试 ✅ success

Rust 测试覆盖率

指标 覆盖率
行覆盖率 67.3%
分支覆盖率 0.0%
模块 行覆盖率
crates.cli-box-core.src.daemon ██████████░░░░░░░░░░ 52.6%
crates.cli-box-core.src.sandbox ███████████████████░ 98.8%
crates.cli-box-core.src ███████████░░░░░░░░░ 55.3%
crates.cli-box-core.src.instance ███████████████████░ 99.1%
crates.cli-box-core.src.server █████████████████░░░ 87.7%
crates.cli-box-core.src.automation ███████████░░░░░░░░░ 58.3%
crates.cli-box-core.src.process ███████████░░░░░░░░░ 57.7%
crates.cli-box-core.src.capture █████████████████░░░ 85.8%

详细报告见 Rust 覆盖率 artifact

前端测试覆盖率

指标 覆盖率
行覆盖率 ████████████████░░░░ 78.0%
分支覆盖率 70.4%
函数覆盖率 74.2%
语句覆盖率 77.5%
文件 行覆盖率
src/tests/mocks/websocket.ts ██████████████████░░ 88.0%
src/tests/mocks/xterm.ts ████████████████████ 100.0%
src/main/daemon-bridge.ts ████████░░░░░░░░░░░░ 40.0%
src/renderer/api.ts ██████████████░░░░░░ 68.2%
src/renderer/screenshotSync.ts ████████████████████ 100.0%
src/renderer/scrollback.ts ██████████████████░░ 88.9%
src/renderer/tabState.ts ████████████████████ 100.0%
src/renderer/terminalBuffer.ts ████████████████████ 100.0%

详细报告见前端覆盖率 artifact

✅ 所有检查通过,可以合入

点击 Squash and merge 合并此PR

@Shadow-Azure
Shadow-Azure merged commit 355e5bc into main Jul 19, 2026
14 checks passed
@Shadow-Azure Shadow-Azure mentioned this pull request Jul 19, 2026
3 tasks
Shadow-Azure added a commit that referenced this pull request Jul 19, 2026
Release v0.4.1 to verify the detached-HEAD fix (#51) in the release
workflow. No code changes since v0.4.0; this version's release.yml run
should be the first with a fully green macOS job.

Co-authored-by: ZN-Ice <zn-ice@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
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