fix(git-changed): accept a bare $GITHUB_BASE_REF branch before the default branch - #102
Merged
Merged
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Found while migrating
@pgsql/lintonto this package: its own implementation resolved$GITHUB_BASE_REFone step further thangit-changeddoes, and that step is worth keeping.origin/still comes first — in Actions only the remote ref is fetched, and a stale local branch of the same name would diff against the wrong commit. But when the remote ref is missing, a local branch of that name is a far better answer than the repository default branch: someone running the tool outside CI withGITHUB_BASE_REFexported, or a job that checked out the base branch by name, gets the base they actually asked for instead of silently being diffed againstmain.Falling through to the default branch only when neither exists. Unchanged: never return a ref that doesn't resolve.
Adds a test for the new fall-through (
$GITHUB_BASE_REF=release/9.9→ default branch); the existing "remote ref missing" test now documents the bare-branch hit rather than the fall-through, with the same assertion.Needs a publish before the
@pgsql/lintmigration can point at it — that PR's suite asserts this exact case.Link to Devin session: https://app.devin.ai/sessions/e84444b40007481e9de0285d8b5340b6
Requested by: @pyramation