fix(github): 支持 GitHub Releases API token#503
Merged
Conversation
deepcoldy
approved these changes
Jul 18, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
二次 review 完成:未发现阻塞项。已独立核对 GitHub token helper、daemon→worker→CLI/tmux 隔离、以及 per-bot 显式注入路径;聚焦回归与构建通过。workflow ephemeral worker 仍继承 daemon token 作为非阻塞后续项。
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.
背景
Dashboard changelog 与 daemon restart-report 会读取 GitHub Releases API。未认证请求在共享出口 IP 下只有较低的速率额度;同时 Node.js
fetch不会自动读取 curl 的~/.curlrc/~/.netrc登录状态,因此需要一条显式、可移植且可审计的认证路径。改动
GITHUB_TOKEN,后备GH_TOKEN;进程环境缺失时只读解析~/.botmux/.env,不修改process.env,不记录或缓存 token。update-check与restart-report的 GitHub Releases 请求统一使用该 helper,Dashboard 与 daemon 共用同一认证语义。GITHUB_TOKEN/GH_TOKEN。本次不新增 Dashboard 设置页、持久化配置或保存接口,也不解析
.netrc,不 shell out 到 curl/gh。公共层影响
验证
corepack pnpm exec vitest run test/github-auth.test.ts test/child-env.test.ts test/update-check.test.ts test/restart-report.test.ts test/session-lifecycle-start.test.ts test/herdr-backend.test.ts test/tmux-env-isolation.test.ts7 files / 134 tests通过。corepack pnpm exec vitest run test/tmux-backend-env.test.ts -t 'wrapper clears every stale managed value|wrapper unsets inherited GitHub tokens'2 tests通过。PATH=/tmp/botmux-corepack-bin:$PATH pnpm buildgit diff --checkGITHUB_TOKEN/GH_TOKEN后,helper 可从真实~/.botmux/.env生成认证 header,且不污染process.env;GitHub/rate_limit返回 200、core limit 5000,Releases 与 changelog 请求成功。pnpm test:9079 passed / 31 failed。相同 31 条失败已在干净 base53518e5aa459313f64f354bdc069af24ffab58da独立复现:25 条来自本机 Git 2.20.1 不支持git init -b,1 条为既有 tmux keep-shell 失败,5 条为既有 v3 timeout/fence 不稳定;因此不声明“全量测试通过”。