Repository navigation
ci: fix desktop release workflow permissions - #5092
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
commit: |
Co-authored-by: kimi-agent-bot <[email protected]>
The fork's release workflow is gated to MoonshotAI with publishing disabled, and its CI has no desktop-e2e/e2e-smoke/layered-qa workflows; record MoonshotAI#5277, MoonshotAI#5092, MoonshotAI#5088, MoonshotAI#5084, MoonshotAI#5309 and MoonshotAI#5264 accordingly.
Requirement or Bug
release/2026-11-19的 Release workflow 在任何 job 启动前被 GitHub 拒绝,导致发布流程无法继续。本 PR 补齐 reusable workflow 调用方缺失的最小权限,使 Release 能通过启动校验并继续既有版本 PR / 发布流程。Bug Reproduction Steps
release/*分支以当前release.yml触发 Release。desktop-artifacts调用desktop-build.yml时,被调用方matrix-source需要actions: read,调用方却未授予该权限。startup_failure,0 jobs)。Root Cause
GitHub 要求 reusable workflow 各 job 声明的权限并集不能超过调用方持有的权限。
desktop-artifacts只声明了contents: write和pull-requests: read,遗漏desktop-build.yml的matrix-source所需的actions: read。这是针对调用方权限声明的根本修复,不改变构建或发布逻辑。Code Changes
desktop-artifacts.permissions contents: write pull-requests: read + actions: read仅修改
.github/workflows/release.yml一行,使调用方权限覆盖被调用方各 job 的权限并集;无产品代码、版本号、changeset、脚本或其他格式化改动。Behavior Changes and Affected Users
desktop-artifactsreusable workflow 的启动校验actions: read在 jobs 启动前失败release/*发布维护者没有 CLI、Desktop、VS Code 产品行为变化,也没有删除行为或翻转默认值。受影响模块仅为 Release workflow;权限修复由静态权限并集断言覆盖,既有发布行为由仓内 release workflow 测试覆盖。
验证
node --test scripts/release.test.mjs scripts/release-trigger.test.mjs scripts/canary-release.test.mjs scripts/desktop-nightly-guard.test.mjs:39/39 通过。pnpm lint:通过,0 warnings / 0 errors。release.yml与desktop-build.yml运行yaml valid:通过。desktop-build.yml各 job 权限并集并断言调用方权限覆盖:通过;并集为contents: write、pull-requests: read、actions: read。git diff --check:通过;最终 diff 仅 1 行新增。Checklist
gen-changesetsskill, or this PR needs no changeset.(CI-only,不需要 changeset。)gen-docsskill, or this PR needs no doc update.(无产品行为或用户文档变化。)Requested by 李瑞丰 via Mira.