From 487c9e8726622325834c06ab3d93fcee2a865f00e4f7d54da1941425ab9741bf Mon Sep 17 00:00:00 2001 From: Maoayo233 Date: Tue, 22 Sep 2026 22:22:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20check.sh=20=E7=9A=84=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E5=B1=82=E8=B7=AF=E5=BE=84=E5=86=99=E9=94=99(?= =?UTF-8?q?=E6=96=AD=E8=A8=80=E8=A2=AB=E9=9D=99=E9=BB=98=E8=B7=B3=E8=BF=87?= =?UTF-8?q?);=20=E5=B9=B6=E6=96=AD=E8=A8=80=E9=A6=96=E9=A1=B5=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ROOT` 是仓库根, 但断言用的是 `${ROOT}/custom/...`, 那个路径根本不存在, 于是 `if [[ -f ... ]]` 永远为假 —— 「生成的 zh-CN 语言文件已无工单」这条从未真正跑过 (在预览/生产上跑都是直接跳过, 看不出来)。改成 `customization/custom/...`。 顺带加上首页(登录后)学期答疑入口卡片的模板层断言: 卡片模板在位 + dashboard.tmpl 里确实 include 了它。渲染结果需要登录才能看, 那部分在 preview.sh check 里 (它用 previewadmin 登录后抓首页)。 实测: customization/check.sh 对预览与生产都跑通(生产多一条 OIDC 入口 307)。 --- customization/check.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/customization/check.sh b/customization/check.sh index 28611e9..18616aa 100755 --- a/customization/check.sh +++ b/customization/check.sh @@ -106,10 +106,19 @@ if [[ -d ${ROOT}/issue-templates ]]; then ! grep -rq "example.com" "${ROOT}/issue-templates/" && ok "Issue 模板已无 example.com 占位链接" || bad "Issue 模板里仍有 example.com" fi -if [[ -f ${ROOT}/custom/options/locale/locale_zh-CN.json ]]; then - ! grep -q "工单" "${ROOT}/custom/options/locale/locale_zh-CN.json" && +if [[ -f ${ROOT}/customization/custom/options/locale/locale_zh-CN.json ]]; then + ! grep -q "工单" "${ROOT}/customization/custom/options/locale/locale_zh-CN.json" && ok "生成的 zh-CN 语言文件已无「工单」" || bad "语言文件里仍有「工单」" fi +# 首页(登录后)的学期答疑入口卡片: 渲染结果需要登录才能看, 这里只断言模板层 +# (运行时的渲染断言在 customization/preview/preview.sh check 里, 要登录)。 +if [[ -f ${ROOT}/customization/custom/templates/custom/tjhlp_semester_card.tmpl ]]; then + grep -q "本学期答疑入口" "${ROOT}/customization/custom/templates/custom/tjhlp_semester_card.tmpl" && + ok "首页答疑入口卡片模板在位" || bad "卡片模板里没有预期的内容" + grep -q 'template "custom/tjhlp_semester_card"' \ + "${ROOT}/customization/custom/templates/user/dashboard/dashboard.tmpl" && + ok "dashboard.tmpl 已 include 学期答疑入口卡片" || bad "dashboard.tmpl 没有 include 卡片" +fi if [[ ${fail} == 0 ]]; then echo "全部检查通过"