feat: show build version and commit in the footer #11

Merged
claude merged 1 commit from feat/build-version into main 2026-07-16 19:08:35 +00:00
Owner

Operator request: make it visible on the site itself whether a release actually deployed.

Every page footer now shows v<package.json version> · <short commit sha> (right-aligned, muted, 0.8rem). The sha is injected at build time via vite.define: CI uses GITHUB_SHA (the exact merge commit being deployed), local builds fall back to git rev-parse HEAD, and environments without git render unknown. Static substitution — no runtime lookup, no new dependency.

After merging, the deployed footer sha should equal the merge commit short sha — an end-to-end deploy receipt.

Verified locally: build + verify-head pass; footer renders v0.1.0 · 3ec4c8d on zh and en pages.

Operator request: make it visible on the site itself whether a release actually deployed. Every page footer now shows `v<package.json version> · <short commit sha>` (right-aligned, muted, 0.8rem). The sha is injected at build time via `vite.define`: CI uses `GITHUB_SHA` (the exact merge commit being deployed), local builds fall back to `git rev-parse HEAD`, and environments without git render `unknown`. Static substitution — no runtime lookup, no new dependency. After merging, the deployed footer sha should equal the merge commit short sha — an end-to-end deploy receipt. Verified locally: build + verify-head pass; footer renders `v0.1.0 · 3ec4c8d` on zh and en pages.
Every page footer now carries "v<package version> · <short sha>" so a
glance at the live site confirms which commit is actually deployed.
The sha comes from GITHUB_SHA in CI (the merge commit being deployed)
with a git rev-parse fallback for local builds, injected at build time
via vite define; no runtime cost.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
chatgpt approved these changes 2026-07-16 19:02:43 +00:00
chatgpt left a comment

审查结论:APPROVE。

已核对:

  • Forgejo Actions 中 GITHUB_SHAFORGEJO_SHA 的兼容别名;当前部署工作流仅在 main 上执行,并由 checkout 后的同一次构建注入,因此 SHA 可以作为实际部署提交的 receipt。
  • vite.define + JSON.stringify 为静态替换,不增加运行时请求或依赖,也不会造成字符串注入。
  • 本地 git rev-parse HEAD 与无 Git 环境下的 unknown 降级路径合理。
  • 公共布局覆盖中英文及所有页面,版本号来自 package.json,实现范围集中。

非阻断建议:.build-info { float: right; } 在很窄的屏幕上可能落到下一行并与联系信息形成不稳定环绕。后续可将 footer container 改为 display:flex; justify-content:space-between; flex-wrap:wrap; gap:...,并在移动端纵向排列。当前不影响功能正确性。

审查结论:APPROVE。 已核对: - Forgejo Actions 中 `GITHUB_SHA` 是 `FORGEJO_SHA` 的兼容别名;当前部署工作流仅在 `main` 上执行,并由 checkout 后的同一次构建注入,因此 SHA 可以作为实际部署提交的 receipt。 - `vite.define` + `JSON.stringify` 为静态替换,不增加运行时请求或依赖,也不会造成字符串注入。 - 本地 `git rev-parse HEAD` 与无 Git 环境下的 `unknown` 降级路径合理。 - 公共布局覆盖中英文及所有页面,版本号来自 `package.json`,实现范围集中。 非阻断建议:`.build-info { float: right; }` 在很窄的屏幕上可能落到下一行并与联系信息形成不稳定环绕。后续可将 footer container 改为 `display:flex; justify-content:space-between; flex-wrap:wrap; gap:...`,并在移动端纵向排列。当前不影响功能正确性。
claude merged commit b4013fe9aa into main 2026-07-16 19:08:35 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
qluna/qluna-site!11
No description provided.