Commit 8c0fc06
fix(ci): workflow path 跟随 i18n URL 段化(修 sync-uuid 失败 + IndexNow 双语推送) (#331)
* fix(ci): workflow path 跟随 i18n URL 段化(app/docs → content/docs)
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。
* fix(ci): IndexNow 提 leetcode slug 时走拼音映射,与实际路由对齐
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 直出,不需要映射)。
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>1 parent e74b5fd commit 8c0fc06
3 files changed
Lines changed: 44 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
80 | 95 | | |
81 | 96 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
94 | 105 | | |
95 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
96 | 119 | | |
97 | 120 | | |
98 | 121 | | |
99 | 122 | | |
100 | 123 | | |
101 | 124 | | |
102 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
103 | 128 | | |
104 | 129 | | |
105 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
0 commit comments