Skip to content

feat(web): show deployed commit SHA in landing footer#31

Merged
cooper (czxtm) merged 1 commit intomainfrom
feat/footer-commit-sha
May 2, 2026
Merged

feat(web): show deployed commit SHA in landing footer#31
cooper (czxtm) merged 1 commit intomainfrom
feat/footer-commit-sha

Conversation

@czxtm
Copy link
Copy Markdown
Contributor

Summary

  • Inject the commit SHA (short, 7 chars) into the web bundle at build time via Vite's define block. Reads process.env.GITHUB_SHA first (set automatically by GitHub Actions) and falls back to git rev-parse --short HEAD for local builds. If both fail, falls back to the literal string "unknown".
  • Render the SHA in the landing footer's bottom row, next to the disclaimer, as a small monospace link to github.com/darkmatter/stackpanel/commit/<sha>. Lets you eyeball whether prod is currently serving the revision you expect.
  • Added apps/web/src/types/build-info.d.ts declaring the __COMMIT_SHA__ global so TypeScript is happy.

Scope is intentionally just the landing footer for now — studio has its own chrome and can be extended later if useful.

Test plan

  • Pull the branch, run bun run dev from apps/web, confirm the footer shows the local short SHA and clicking it opens the right GitHub commit URL.
  • After deploy, hit the production landing page and confirm the SHA matches the main HEAD that triggered the deploy.

https://claude.ai/code/session_01WGbZGB93xMgBpBmoUDk91w


Generated by Claude Code

Inject GITHUB_SHA (or local git rev-parse fallback) at build time via
Vite's `define` and render it in the landing footer as a link to the
GitHub commit. Lets you eyeball whether the production deploy is on
the expected revision.

https://claude.ai/code/session_01WGbZGB93xMgBpBmoUDk91w
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Preview deployed to pr-31https://pr-31.stackpanel.com

@czxtm cooper (czxtm) marked this pull request as ready for review May 2, 2026 15:44
@czxtm cooper (czxtm) merged commit cd914e8 into main May 2, 2026
3 of 4 checks passed
@czxtm cooper (czxtm) deleted the feat/footer-commit-sha branch May 2, 2026 15:44
@cursor
Copy link
Copy Markdown

cursor Bot commented May 2, 2026

PR Summary

Low Risk
Low risk: build-time metadata injection and a small footer UI tweak; main risk is misreporting SHA in non-git/CI environments (falls back to unknown).

Overview
Adds a build-time __COMMIT_SHA__ constant (sourced from GITHUB_SHA or git rev-parse --short HEAD, else "unknown") via Vite’s define config.

Updates the landing footer to show the deployed SHA as a monospace link to the corresponding GitHub commit, and adds a build-info.d.ts declaration so TypeScript recognizes the injected global.

Reviewed by Cursor Bugbot for commit 7dd303c. Configure here.

cooper (czxtm) added a commit that referenced this pull request May 2, 2026
feat(web): show deployed commit SHA in landing footer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants