fix(ci): workflow path 跟随 i18n URL 段化(修 sync-uuid 失败 + IndexNow 双语推送)#331
Merged
longsizhuo merged 2 commits intomainfrom May 6, 2026
Merged
fix(ci): workflow path 跟随 i18n URL 段化(修 sync-uuid 失败 + IndexNow 双语推送)#331longsizhuo merged 2 commits intomainfrom
longsizhuo merged 2 commits intomainfrom
Conversation
i18n PR (#330) merge 后,sync-uuid workflow 在 main 上 fail: git add 'app/docs/**/*.md' 'app/docs/**/*.mdx' 因为 app/docs 已经 不存在,pathspec 不匹配任何文件,git 退出码 128 → workflow 失败。 backfill 脚本本身 OK(已成功生成 JSON),失败在最后 commit 那一步。 修: 1. sync-uuid.yml - paths trigger: app/docs/** → content/docs/** - git diff / git add 路径同步改 content/docs 2. content-check.yml - paths trigger: app/docs/** → content/docs/** 3. deploy.yml (IndexNow 推送) - 删掉旧 app/docs/(.*)/page.tsx 提取分支(不再有 page.tsx-as-content) - content/docs/(.*).mdx 提 base slug 时剥离 locale 后缀(.en/.zh), 拿到 canonical slug - 每篇文档推送 zh + en 两条 URL(/zh/docs/<slug> + /en/docs/<slug>), i18n 段化后这是两个独立 URL,IndexNow 要分别通知 - fallback URL 也改成双语 ($SITE_ORIGIN/zh + $SITE_ORIGIN/en) 注:generated/doc-contributors.json 留给 sync-uuid workflow 修好后 下次跑自己 commit,不进本 PR。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes CI workflows impacted by the docs i18n refactor (moving MDX content to content/docs/ and introducing locale-prefixed docs URLs), restoring the contributor backfill workflow and updating IndexNow submissions to target the new /zh/... and /en/... routes.
Changes:
- Update
sync-uuid.ymlandcontent-check.ymlpath filters and auto-commit pathspecs fromapp/docs/**tocontent/docs/**. - Update
deploy.ymlIndexNow URL extraction to derive slugs fromcontent/docs/**/*.md(x)and submit both/zh/docs/...and/en/docs/...URLs (plus/zhand/enfallback home URLs).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/sync-uuid.yml | Fixes workflow trigger + auto-commit paths after docs content moved to content/docs/. |
| .github/workflows/deploy.yml | Updates IndexNow URL generation to locale-prefixed docs URLs and dual-language submission. |
| .github/workflows/content-check.yml | Aligns PR path triggers with content/docs/ after the docs content move. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
88
to
99
| while IFS= read -r f; do | ||
| [ -z "$f" ] && continue | ||
| if [[ "$f" =~ ^content/docs/(.*)\.(md|mdx)$ ]]; then | ||
| slug="${BASH_REMATCH[1]}" | ||
| # 剥离 locale 后缀(.en / .zh),拿到 canonical base slug | ||
| slug="${slug%.en}" | ||
| slug="${slug%.zh}" | ||
| # index.mdx 对应目录本身的 URL(fumadocs 约定) | ||
| slug="${slug%/index}" | ||
| URLS+=("$SITE_ORIGIN/docs/$slug") | ||
| URLS+=("$SITE_ORIGIN/zh/docs/$slug") | ||
| URLS+=("$SITE_ORIGIN/en/docs/$slug") | ||
| fi |
CR (Copilot) 指出 #331 的 deploy.yml 直接拿文件路径当 slug,但 lib/source.ts 的 transformer 把 career/interview-prep/leetcode/ 下 含中文的文件名拼音化(convertSlugToPinyin): 文件:content/docs/career/interview-prep/leetcode/142.环形链表II_translated.md 实际路由:/<locale>/docs/career/interview-prep/leetcode/142-huan-xing-lian-biao-iitranslated 我之前推的:/<locale>/docs/career/interview-prep/leetcode/142.环形链表II_translated ← 404 修:在 deploy.yml 的 IndexNow URL 提取里复用 generated/leetcode-slug-map.json (prebuild 时由 scripts/generate-leetcode-slug-map.mts 用同一份算法生成), 对 leetcode 子树的 slug 做 stem → 拼音 映射后再推送。 非 leetcode 子树的 slug 不受影响(它们的文件名都是 ASCII,路由按 file path 直出,不需要映射)。
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.
问题
i18n PR #330 merge 后两个 CI 问题:
1. `sync-uuid` workflow 在 main 上 fail(hard error)
Run #25441855788 失败:
```
fatal: pathspec 'app/docs/**/*.md' did not match any files
2026/05/06 14:38:15 Process exited with status 128
```
backfill 脚本本身已经成功生成 153 条 contributor entries(都是 content/docs/...
路径,证明改造对了),但最后这一步:
```yaml
git add 'app/docs//*.md' 'app/docs//*.mdx' generated/doc-contributors.json
```
`app/docs/` 已经搬到 `content/docs/` 整个删除了,pathspec 不匹配 → git 退
出 128 → workflow fail。贡献者署名生命线挂了。
2. `deploy.yml` 的 IndexNow 推送 URL 没加 locale 前缀
i18n 段化后 docs URL 都是 `/zh/docs/...` 或 `/en/docs/...`。当前推送的是
`/docs/...`(不带 locale),Bing/Yandex 收到后会:
修
`sync-uuid.yml`
`content-check.yml`
`deploy.yml` (IndexNow)
canonical slug
影响
(含 153 条 i18n 改造后的最新署名快照)。本 PR 故意不带这个 JSON
改动,留给 workflow 自己 commit,避免人工出错
URL 索引
Test plan