Skip to content

gh-page 工作流因 mkdocs-material-insiders 凭据失效而中断,fallback 未生效 #166

Description

@SongshGeo

现象

gh-page 工作流自 2026-04-18 起首次运行即失败,文档无法部署。

失败发生在 Install dependencies (uv) 步骤,尚未进入任何 deploy 步骤

Updating https://****@github.com/squidfunk/mkdocs-material-insiders.git (HEAD)
error: Git operation failed
  Caused by: failed to clone into: /home/runner/work/_temp/setup-uv-cache/git-v0/db/a15f17b712d6c48c
  Caused by: process didn't exit successfully: `/usr/bin/git fetch --force --update-head-ok
    'https://****@github.com/squidfunk/mkdocs-material-insiders.git' '+HEAD:refs/remotes/origin/HEAD'`
    (exit status: 128)
    --- stderr
    remote: Repository not found.
    fatal: repository 'https://github.com/squidfunk/mkdocs-material-insiders.git/' not found
##[error]Process completed with exit code 2.

根因

mkdocs-material-insiders 是 squidfunk 面向赞助者的私有仓库。对私有仓库返回 Repository not found 即表示无访问权限 —— secrets.GH_TOKEN 已失效(PAT 过期/被轮换,或赞助到期)。

关键在于 .github/workflows/gh-page.yml:46-51 的守卫只检查 token 是否存在,不检查是否可用

set -e
uv sync --group docs --dev
if [ -n "${{ secrets.GH_TOKEN }}" ]; then
  uv pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
else
  echo "GH_TOKEN not set; installing mkdocs-material (public) instead"
  uv pip install mkdocs-material
fi

token 仍然存在、只是已无权限,于是进入 if 分支,安装失败叠加 set -e 直接终止 job。为失效凭据准备的公版 fallback(:50永远不会被触发

时间线(与 PR #165 无关)

这是该工作流的首次失败;gh-page.yml 最近 12 次运行中,此前全部成功:

结论 分支 时间
failure dev 2026-08-14
success master 2026-04-18
success dev 2026-04-18
success master 2026-04-07

即:凭据是在 2026-04-18 → 2026-08-14 这约四个月的空窗期内失效的,期间无人推送 dev/master。PR #165 只是第一个把它暴露出来的推送,其改动(链接顺序/RNG/cell ID)与文档构建无任何关系。

附带发现:可能已不再需要 insiders

mkdocs.yml 中唯一的 insiders 专有插件 typeset 已被注释停用mkdocs.yml:134):

    # - typeset

其余启用的插件均为公版可用:searchmkdocs-jupytermkdocstringsexcludebibtexmacroscalloutsglightboxtagsmike

注意:mkdocs.yml:188-190tags: / social: 位于 extra: 段下,是页脚链接与标签映射配置,并非 insiders 插件,容易误判。

因此公版 mkdocs-material 很可能足以完成构建。

建议修复

按推荐顺序:

  1. 让 fallback 真正生效(最小改动、最稳)——把判断从「token 是否存在」改为「insiders 装失败即退回公版」,例如:

    uv pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git \
      || uv pip install mkdocs-material

    这样今后凭据再次失效时,文档仍能正常发布,而不是整条流水线崩掉。

  2. 彻底移除 insiders 依赖 —— 若确认不再续赞助,删除 gh-page.yml:46-51 的相关分支及 setup_insiders.sh:21),最为干净。

  3. 续期/更新 GH_TOKEN secret —— 若仍在赞助且希望保留 insiders 特性。此项需仓库管理员操作。

1 与 2/3 并不互斥:即便续期了 token,仍建议一并做 1,避免同类静默失效再次阻断发布。

验证方式

gh-page.yml 已内建 workflow_dispatch + dry_run 输入(:9-13:54-57),可只构建不部署,用于验证公版 mkdocs-material 能否通过 mkdocs build --strict

Actions → gh-page → Run workflow → dry_run: true

影响

  • 文档站 https://songshgeolab.github.io/ABSESpy/ 目前仍可访问(GitHub Pages status: built,源为 gh-pages 分支),但内容停留在最后一次成功部署,此后的改动均未发布。
  • 每次向 master/main/dev 推送都会产生一个失败的 CI 检查。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚙️ ciContinuous integration and workflows📄 documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions