ci(Publish): 门控 VS Code Marketplace 自动发布以消除 deployments 报错 - #32
Merged
ThreeFish-AI merged 1 commit intoJun 29, 2026
Merged
Conversation
未配置 VSCE_PAT 时, publish job 的 vsce 发布步骤鉴权失败会中断整个 job; 因该 job 挂 environment: production, 导致仓库 /deployments 页持续产生 error 状态的 deployment 记录。 改为用仓库变量 ENABLE_MARKETPLACE_PUBLISH 门控该步骤 (默认未设即 skipped, 不致 job 失败), OpenVSX 发布步骤保持无条件执行; 日后配好 VSCE_PAT 后, 在仓库 Variables 设 ENABLE_MARKETPLACE_PUBLISH=true 即恢复, 无需改代码或发 PR。 同步在 docs/research/04-publishing-cicd.md 增设 3.2.2 节, 说明该特性开关、OpenVSX 不受影响及历史 deployment 清理方式。 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
ThreeFish-AI
added a commit
that referenced
this pull request
Jun 29, 2026
同步 #31(Branches 视图多选 + 批量删除/复制/收藏)与 #32(门控 Marketplace 自动发布以消除 deployments 报错);解决 CHANGELOG.md [Unreleased] 区段冲突——按 Keep a Changelog 顺序保留双条目(### Added → ### Changed)。 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
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.
背景
仓库 /deployments 页面持续报错。由于 VS Code Marketplace 发布凭证(
VSCE_PAT)尚未配置,每次推送v*tag 触发的publishjob 会在vsce publish步骤鉴权失败,进而中断整个 job。该 job 声明了environment: production,因此每次失败都会在/deployments页留下一条 error 状态的 deployment 记录。根因
.github/workflows/ci.yml的publishjob 中,「发布到 VS Code Marketplace」步骤排在「发布到 OpenVSX」之前且无continue-on-error。Marketplace 步骤鉴权失败后整个 job 中止,OpenVSX 步骤也无从执行,productiondeployment 被标记为 error。改动
if: ${{ vars.ENABLE_MARKETPLACE_PUBLISH == 'true' }}。变量未设置时其值为空串,条件为假 → 步骤显示为 skipped(而非 failed),不致 job 失败。ovsx publish步骤继续无条件发布,Cursor / Windsurf 等 AI IDE 用户的安装来源不中断。publishjob 注释;在docs/research/04-publishing-cicd.md增设 §3.2.2,说明该特性开关、OpenVSX 不受影响及历史 deployment 清理方式。效果
Marketplace 步骤被跳过后,job 直接执行 OpenVSX 步骤;只要
OVSX_PAT已配置且发布成功,productiondeployment 即由红转绿,报错消除。github-release(附带.vsix供本地安装)不受影响,正常产出。日后恢复(零代码)
取得 Azure DevOps PAT 后,在仓库
Settings → Secrets and variables → Actions:VSCE_PAT;ENABLE_MARKETPLACE_PUBLISH=true。即恢复 Marketplace 自动发布,无需改动 workflow 或再发 PR。
前提与注意
OVSX_PAT已配置且 open-vsx.org 命名空间有效)。若OVSX_PAT也未配置,OpenVSX 步骤会失败、productiondeployment 仍会标红——届时需改为在 job 层门控以整体跳过该 job。/deployments上已有的历史失败记录不会自动消失,如需清空可在Settings → Environments → production删除该环境(会一并清除其 deployment 历史,下次发布按environment: production自动重建),或经 REST API 逐条删除。验证
ci.yml语法合法;确认 Marketplace 步骤if条件生效、OpenVSX 步骤保持无条件执行。v*(或测试性rc)tag 时观察:Marketplace 步骤 skipped、OpenVSX 正常执行、productiondeployment 转绿。🤖 Generated with Claude Code