feat: auto-fetch head-ref from GitHub Actions in detached HEAD state#2805
Merged
runningcode merged 1 commit intomasterfrom Sep 29, 2025
Merged
feat: auto-fetch head-ref from GitHub Actions in detached HEAD state#2805runningcode merged 1 commit intomasterfrom
runningcode merged 1 commit intomasterfrom
Conversation
Add `get_github_head_ref()` function to automatically detect head branch from GitHub Actions environment variables when running in PR workflows. This resolves detached HEAD scenarios by using GITHUB_HEAD_REF instead of requiring manual --head-ref specification. Resolves EME-367 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
59c1f46 to
332fe76
Compare
szokeasaurusrex
approved these changes
Sep 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_github_head_ref()function to automatically detect head branch from GitHub Actions environment variablesGITHUB_HEAD_REFfor automatic head-ref detection in PR workflowsSee context reference: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
Context
Resolves EME-367 - Auto-fetch correct head-ref value in detached HEAD state using GitHub Actions env variables. Follows the same pattern as recent work on base SHA auto-fetching (#2799).
🤖 Generated with Claude Code
Note
Adds get_github_head_ref() (reads GITHUB_HEAD_REF in pull_request) and makes build upload prefer it before git head ref to handle detached HEAD.
src/commands/build/upload.rshead-ref resolution to first useget_github_head_ref(); fall back togit_repo_head_ref.get_github_head_ref()to readGITHUB_HEAD_REFwhenGITHUB_EVENT_NAMEispull_requestwith debug logging.utils::vcsand upload command.Written by Cursor Bugbot for commit 332fe76. This will update automatically on new commits. Configure here.