From 2e6bb9a26288bf3c837363e10fa00d54f0516c14 Mon Sep 17 00:00:00 2001 From: Zhengchen Tao Date: Sat, 2 May 2026 18:26:40 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20CLAUDE.md=20=E8=A7=A3=E9=87=8A=20ci/cus?= =?UTF-8?q?tom=20=E4=B8=8D=E9=9C=80=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4=20?= =?UTF-8?q?+=20UI=20commit=20=E4=B8=8D=E7=AD=89=E4=BA=8E=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充三分支拓扑后的"FAQ 段": - ci 与 custom 内容不重叠是设计,不是 bug - Gitea Actions UI 顶部显示的 commit 是 workflow dispatch 触发 位置(即 ci 的 HEAD),不是构建源代码 commit - 真实构建的代码 commit 在镜像 tag / OCI revision label / workflow 末尾 Build summary 三处都能看到,看 summary 区即可 附两条可选替代方案(workflow 挪 custom / 加 push trigger 自动构建), 说明当前选择的中间路径理由。 Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 3d8f1c33..2be1924b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,6 +36,29 @@ git.zhengchentao.win/dev/ezbookkeeping (origin,本地唯一 remote) ⚠️ origin 的 default branch 是 `ci` 不是 main 也不是 custom。`git clone` 默认会落在 ci。要做开发先 `git checkout custom`。 +### ci 与 custom 不需要保持一致(这是设计,不是 bug) + +三分支各管各的,**ci 与 custom 内容不重叠**: + +- ci:只有 `.gitea/workflows/*.yml` +- custom:fork 代码 + FORK.md / CLAUDE.md / .gitignore 等 +- 理论上没有共享文件(除了 inherit 自上游的部分,例如 ci 分支也有 README、Dockerfile 等基底文件,但很少改它们) + +**Gitea Actions UI 顶部显示的 commit 是 ci 的 HEAD,不是被构建的源代码 commit**。这是因为 workflow 文件在 ci 分支,dispatch 触发时 UI 引用的是 workflow 文件所在 commit。但实际: + +1. `actions/checkout` 用 `ref: ${{ inputs.branch }}` 拉的是 custom +2. 镜像 tag 用 custom 的 short SHA +3. OCI label `org.opencontainers.image.revision` 是 custom 的 full SHA +4. workflow 末尾 Build summary 步骤把上述源 commit 显式写入 `$GITHUB_STEP_SUMMARY`,运行页面有突出显示 + +所以**真实构建的代码 commit** 在镜像本身、运行页面 summary 区都能看到,UI 顶部那个只是 dispatch 触发位置的 commit,**不是 bug,无需修复,看 summary 区即可**。 + +如果哪天觉得这种割裂太烦,可选两个替代方案: +- 把 workflow 挪到 custom,删 ci(UI commit 直接对得上,但失去 meta/code 分离) +- 加 `push: branches: [custom]` 自动触发(每次 push 自动 build,更直观但费 CI 时间) + +当前选 `workflow_dispatch only + summary step` 是中间路径,节省 CI 又能看到真实信息。 + --- ## ci 分支 workflow 清单