🐛 fix(spx): GITEA_TOKEN 只发给 tea 登录过的 host,origin 不在 tea 里时直接报错

This commit is contained in:
cruldra committed 2026-10-19 08:50:20 +11:00
1 parent e6d086d821
commit 9c7c9d8636
6 files changed
+43 -25

No files matched your search

+2 -2
View File
@@ -16,9 +16,9 @@ spx 读 `git remote get-url origin`,按 host 决定连哪种仓库(`--host`
| origin host | 仓库 | token 来源 |
| --- | --- | --- |
| `github.com` | GitHub(API `https://api.github.com`) | `gh auth token --hostname github.com`;取不到就先运行 `gh auth login` |
| 其它任何 host | Gitea(API `<host>/api/v1`) | [`tea`](https://gitea.com/gitea/tea) 配置 `~/.config/tea/config.yml` 里 URL 与 origin 同 host 的 login;没有该 login 或 token 为空时回退环境变量 `GITEA_TOKEN` |
| 其它任何 host | Gitea(API `<host>/api/v1`) | [`tea`](https://gitea.com/gitea/tea) 配置 `~/.config/tea/config.yml` 里 URL 与 origin 同 host 的 login;该 login 的 token 为空时用环境变量 `GITEA_TOKEN` 补上;tea 里没有这个 host 的 login 就报错,要先运行 `tea login add` |
tea 用 keyring 存 token(v0.10+ 默认行为)时,可以设 `GITEA_TOKEN` 作为回退:
tea 用 keyring 存 token(v0.10+ 默认行为)时,配置文件里的 login 没有 token,可以设 `GITEA_TOKEN` 补上。`GITEA_TOKEN` 只会发给 tea 里登录过的 host,origin 指向别的 host 时 spx 直接报错,不会把它发出去:
```
export GITEA_TOKEN=...