feat: auto-fetch head-ref from GitHub Actions in detached HEAD state #2805
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_REF
for 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.rs
head-ref resolution to first useget_github_head_ref()
; fall back togit_repo_head_ref
.get_github_head_ref()
to readGITHUB_HEAD_REF
whenGITHUB_EVENT_NAME
ispull_request
with debug logging.utils::vcs
and upload command.Written by Cursor Bugbot for commit 332fe76. This will update automatically on new commits. Configure here.