Skip to content

Revert commit SHA resolution to git merge-base#628

Merged
IEvangelist merged 2 commits intomainfrom
copilot/revert-breaking-changes-commit-link
Mar 30, 2026
Merged

Revert commit SHA resolution to git merge-base#628
IEvangelist merged 2 commits intomainfrom
copilot/revert-breaking-changes-commit-link

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

The footer's commit link was broken because PR #601 changed getCommit() to use GITHUB_SHA / git rev-parse HEAD, both of which can produce synthetic merge commit SHAs that don't exist in the public repo history.

Changes

  • src/frontend/scripts/write-git-env.mjs: Reverts getCommit() to git merge-base origin/main HEAD with upstream/main HEAD as a fork fallback — this always resolves to a real commit on main.
// Before (broken): resolves GITHUB_SHA, which is a synthetic merge commit in CI
return getExplicitCommit() ?? tryExec('git rev-parse HEAD') ?? '';

// After (fixed): resolves the actual ancestor commit on main
return (
  tryExec('git merge-base origin/main HEAD') ??
  tryExec('git merge-base upstream/main HEAD') ??
  ''
);

The non-breaking .env.local file I/O refactor from PR #601 is retained.


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI linked an issue Mar 27, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix broken commit link on deployment page Revert commit SHA resolution to git merge-base Mar 27, 2026
Copilot AI requested a review from IEvangelist March 27, 2026 14:25
@IEvangelist IEvangelist marked this pull request as ready for review March 27, 2026 14:49
Copilot AI review requested due to automatic review settings March 27, 2026 14:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the frontend footer’s commit SHA link by changing how the build determines the commit: instead of using CI-provided SHA values that may refer to synthetic merge commits, it resolves a commit that exists on the public main history via git merge-base.

Changes:

  • Remove CI/env-based SHA resolution and compute the commit via git merge-base .../main HEAD.
  • Add upstream/main as a fallback remote for fork workflows while keeping the .env.local write logic from #601.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IEvangelist IEvangelist enabled auto-merge (squash) March 27, 2026 16:18
@IEvangelist IEvangelist merged commit 0642409 into main Mar 30, 2026
10 checks passed
@IEvangelist IEvangelist deleted the copilot/revert-breaking-changes-commit-link branch March 30, 2026 19:26
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.

Commit link is broken

4 participants