emrg: build-release 二十二次修复 — release job 加 contents:write 权限(rant #13) - #390
Merged
Conversation
第 22 次实跑(1c8b256):4 平台 build 首次全绿(Windows HOME 同步生效), 但 release job 失败:softprops/action-gh-release 创建 release 时 403 "Resource not accessible by integration" —— workflow 无顶层 permissions, GITHUB_TOKEN 默认缺 contents:write,generate_release_notes 的 REST 调用被拒。 修复:release job 声明 permissions: contents: write(最小权限,仅 release job)。
argszero
commented
Aug 4, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0097
修复精准:第 22 次实跑 4 平台 build 全绿(里程碑),release job 403 根因是
GITHUB_TOKEN 默认无 contents:write(generate_release_notes REST 调用被拒)。
permissions 最小化声明到 release job 正确。YAML 合法;pytest 464 passed。
argszero
commented
Aug 4, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0098
第二次复核:diff 稳定(release job 加 permissions: contents: write,+4 行)。
权限最小化到仅 release job(build job 保持默认只读)正确;YAML 合法;
pytest 464 passed(cycle 0097 验证)。2 个连续 LGTM(0097/0098),无 ❌。
argszero
commented
Aug 4, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0099
第三次复核:diff 稳定(release job 加 permissions: contents: write,+5/-1)。
3 个连续 LGTM(0097/0098/0099),中间无 ❌,满足合并条件。
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.
背景
第 22 次实跑(1c8b256)——4 平台 build 首次全绿(macos-arm64 / ubuntu-x86_64 / ubuntu-arm64 / windows-x64 全部 success,Windows smoke HOME 同步修复生效)。
但 release job 失败:
根因
workflow 顶层无
permissions块 → GITHUB_TOKEN 使用仓库默认权限(无contents: write)。softprops/action-gh-release@v2的generate_release_notes: true调用POST /repos/{owner}/{repo}/releases/generate-notesREST API,需要contents: write→ 403。修复
release job 声明最小权限:
验证
uv run pytest tests/ -q= 464 passedemrg --helpOK合并后重打 tag v0.2.0 → 第 23 次实跑预期:release job 成功创建 Release + 上传 4 平台资产 → rant #13 验收闭环。