From aabc9e29d955668dce69826dcc1bee637d14ff86 Mon Sep 17 00:00:00 2001 From: Zhengchen Tao Date: Sat, 2 May 2026 18:25:41 +0800 Subject: [PATCH] =?UTF-8?q?build-image=20workflow=20=E5=8A=A0=20build=20su?= =?UTF-8?q?mmary=20=E6=98=BE=E5=BC=8F=E6=A0=87=E5=87=BA=E6=BA=90=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gitea Actions UI 顶部显示的 commit 是 workflow 文件所在分支(ci)的 HEAD —— 是 workflow dispatch 的位置,不是镜像实际构建的源代码 commit。 这给用户造成困惑("build 显示的 commit 不是真实 commit")。 新增 Build summary 步骤,always() 触发,写入 GITHUB_STEP_SUMMARY, 让 Action 运行页面 summary 区显式列出: - 源分支 - 源 commit full SHA - 源 commit short hash - 镜像 tag 并附明确警示说明 UI 顶部 commit 不是构建源 commit。 ci/custom 分支保持各自独立的设计不变(meta vs code 分离),仅改进 UI 信息呈现。 Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/build-image.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index 9e859a28..665e4827 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -70,4 +70,24 @@ jobs: org.opencontainers.image.revision=${{ steps.meta.outputs.full_sha }} tags: | git.zhengchentao.win/dev/ezbookkeeping:${{ steps.meta.outputs.image_tag }} - git.zhengchentao.win/dev/ezbookkeeping:latest \ No newline at end of file + git.zhengchentao.win/dev/ezbookkeeping:latest + + - name: Build summary + # 写入 GITHUB_STEP_SUMMARY 让 Action 运行页面顶部显示真实构建信息。 + # workflow 文件在 ci 分支,UI 顶部显示的 commit 是 ci 的 HEAD(workflow + # 触发位置),不是被构建的源代码 commit。这一步显式把"实际构建的源代码 + # 信息"放到 summary 区,避免误读。always() 保证 build 失败也输出。 + if: always() + run: | + { + echo "## Build Summary" + echo "" + echo "| 项 | 值 |" + echo "|---|---|" + echo "| 源分支 | \`${{ inputs.branch }}\` |" + echo "| 源 commit (full) | \`${{ steps.meta.outputs.full_sha }}\` |" + echo "| 源 commit (short) | \`${{ steps.meta.outputs.image_tag }}\` |" + echo "| 镜像 tag | \`git.zhengchentao.win/dev/ezbookkeeping:${{ steps.meta.outputs.image_tag }}\` + \`:latest\` |" + echo "" + echo "> ⚠️ 本次 workflow run 顶部显示的 commit 是 **ci 分支** 上 workflow 文件的 commit(dispatch 触发位置),**不是**被构建的源代码 commit。镜像实际构建自上面表格中的源 commit。" + } >> "$GITHUB_STEP_SUMMARY" \ No newline at end of file