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
[BUG] Very simple branch gives: "Unable to find merge-base between main and HEAD." #797
Comments
Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience. |
I just updated the logs above to include debug info. |
I dug into the bash script here and I think it just boils down to the commit in the CI run not showing up as a child commit of main so that we trigger the error here. Line 164 in 43835a2
Digging in, it appears that the problem is somehow connected to GitHub's speculative merging being pulled in by the It looks like it's possible to turn off this behavior: https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit I don't think this fully explains the errors I'm seeing but I just wanted to give an update. I'll keep debugging for a little bit. |
I'm trying out this snippet as a way to circumvent the speculative pull request merge commits.
|
That snippet seems to work! I think my problem is temporarily solved, but I'll leave this open in case you all want to take any action here. It still feels like there should be a better solution. Thanks!! |
This is super helpful @tbenthompson, Thanks |
@tbenthompson Curious what was the initial setup you had for the checkout action? |
Here's the relevant subset of our workflow yml from before the
|
Given the PR, should I be okay to remove the Thanks for getting to the bottom of this!! |
I'm seeing this or something very similar upgrading from v25 to v34.4.
fails with The later sha there is not to be found in the repo so I assume it is the merge commit. The actions currently work as expected using v25 of this action. Bisecting, it works on v31 and fails on v32, v33 and v34. Attempting to pass
The sha there is the latest sha of the branch for the pull request. |
@kategengler Curious does the error persist even when using |
High-level description: This bug occurs when the fork point and the last commit of the base branch differ, resulting in errors finding the merge-base as the checkout action merges the tip of the target branch to the PR branch. To prevent this error going forward a pre-check to determine the validity of merge-base would be used falling back to the last commit of the target branch where necessary. |
Correct head.sha per tj-actions/changed-files#797
Is there an existing issue for this?
Does this issue exist in the latest version?
Describe the bug?
git checkout -b ...
andgit commit
.Unable to find merge-base between main and HEAD.
The issue seems to resolve if I push another commit, even an empty commit. So there is a workaround, but this definitely seems like a bug.
Thanks for any help! I can't see anything in the logs, but I'm also not sure what I should be looking for.
To Reproduce
(above)
What OS are you seeing the problem on?
ubuntu-latest or ubuntu-20.04
Expected behavior?
Relevant log output
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: