Repository navigation
ci: 修复 release 发布被 pnpm git 校验拒绝 - #6
Merged
Merged
Conversation
better-er
added a commit
that referenced
this pull request
Sep 3, 2026
ci: 修复 release 发布因 detached HEAD 被 pnpm git 校验拒绝 (#6)
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.
改动概述
修复 Release 发布工作流首次跑 tag 即失败的问题。
失败原因
推送
v0.1.1触发 Release 后,pnpm publish步骤报ERR_PNPM_GIT_UNKNOWN_BRANCH:pnpm 默认要求 HEAD 挂在 master 或 main 分支上,而 tag 触发的 CI 里 checkout 为 detached HEAD,不挂任何分支,故被 git 校验拒绝。修复
给
pnpm publish加--no-git-checks,跳过该 git 校验。这是 pnpm 官方推荐的 tag 发布场景做法,发布本体不受影响。验证
v0.1.1tag force 移到新 commit 并重推,才能重触发发布。