-
-
Notifications
You must be signed in to change notification settings - Fork 235
feat: Add GitHub Actions base branch detection for EME-320 #2776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Implement GitHub Actions-aware base branch detection that works in detached HEAD states commonly found in CI/CD environments. Changes: - Add get_github_base_ref() function to read GITHUB_BASE_REF env var - Prioritize GitHub Actions env vars over git introspection for reliability - Update test snapshots to remove base branch detection warning - Maintain backward compatibility with existing git-based detection 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the change! I have a quick question though about precedence
szokeasaurusrex
approved these changes
Sep 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification 🚀
szokeasaurusrex
added a commit
that referenced
this pull request
Sep 23, 2025
runningcode
added a commit
that referenced
this pull request
Sep 23, 2025
runningcode
added a commit
that referenced
this pull request
Sep 24, 2025
## Summary Reverts commit c0beb47 to restore the GitHub Actions base branch detection functionality that was previously implemented in #2776. ## Background The original GHA base branch detection was reverted in #2789 due to CI failures on master. However, those test failures were actually resolved separately in #2791 by adding `--log-level=error` to suppress warning messages in the integration tests. ## Changes This PR restores: - `get_github_base_ref()` function in `src/utils/vcs.rs` that detects base branch from `GITHUB_BASE_REF` environment variable - Integration of GHA base branch detection in the build upload command logic - Tests for the `get_github_base_ref()` function The test failures that caused the original revert have been resolved by the test fixes in #2791, so this functionality can now be safely restored. 🤖 Generated with [Claude Code](https://claude.ai/code)
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
Implements GitHub Actions-aware base branch detection that works in detached HEAD state
Problem
In GitHub Actions pull request workflows, repositories are checked out in detached HEAD state, causing the existing
git_repo_base_ref()
function to fail when trying to detect the base branch for merge-base calculations.Solution
get_github_base_ref()
that reads theGITHUB_BASE_REF
environment variable--base-ref
argumentThis leverages the GitHub Actions context variables that are automatically set in pull request workflows, specifically
GITHUB_BASE_REF
which contains the target branch of the pull request.🤖 Generated with Claude Code