Files
market/.github
Yige 7db9f6e925 fix(ci): i18n-translate 支持 fork PR (#38)
## 问题

PR #36(来自 fork)触发 `i18n Auto-Translate` workflow 失败,两处报错:

1. **checkout 失败**:`ref: github.event.pull_request.head.ref` 未指定
`repository:`,fork 的 head 分支在主仓库不存在 → `A branch or tag with the name
'add-mattpocock-skills' could not be found`
2. **失败打标签 403**:fork PR 的 `GITHUB_TOKEN` 被强制只读、拿不到
`DESIRECORE_BOT_TOKEN` secret → `Resource not accessible by integration`

## 修复

- **checkout**:同仓库 PR 仍检出 head 分支(保留自动回推翻译);fork PR 改用 `github.ref`(即
`refs/pull/N/merge`,base 仓库中一定存在)
- **新增 "Fail fork PR with stale translations" 步骤**:fork PR 缺翻译时在消耗模型
token 之前直接失败,并提示贡献者本地运行 `uv run scripts/i18n/translate.py` 补交翻译
- **Commit & push / Label on failure** 两个写操作步骤加同仓库判断,fork PR 跳过

同仓库 PR 与 workflow_dispatch 行为完全不变。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 16:41:13 +08:00
..