Open tacaswell opened 6 years ago
Squash merge should now be handled.
(not rebase one though).
As a temporary fix, could the bot report an error in this case instead of opening a bad PR?
As a temporary fix, could the bot report an error in this case instead of opening a bad PR?
Probably I would have to dive into the code and figure out how to detect that ; and post a message. Feel free to send a PR if you have the time.
I took a quick look and couldn't figure out how to tell if a merge commit came from a rebase or squash (at least from the github rest api) (pull request docs). Either way, the merge_commit_sha
exists on the target branch, and does not exist in the PR commits.
Closest alternative I thought of would be to sidestep this, do the equivalent of gh pr checkout {pr}
, and cherry-pick the commits from the branch this creates. Not really sure of the ways this could fail, however.
From the GraphQL API, associatedPullRequests
of commits created from rebasing will point to the correct PR. This might be an alternative solution.
Trying to cherry-pick a squash-merge results in errors like:
Falling back to without
-m 1
would work in this case, but would likely fail in interesting ways for rebase-merge.