You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
The "Update Branch" button in the pull request user interface can be used to merge commits from the base branch into the compare branch. There is no corresponding action in the GitHub API. You can use the GitHub Merge API if the base branch and the compare branch are in the same repository. But you cannot sync across a fork using the GitHub API. This is annoying because the functionality has already been implemented (because it's in the user interface) but it is not available programmatically.
Reacted by Craig Gidney, Ricky Catron, Darren, Hafiz Saqib Javed and Yeikel Santana
It's been a while since I tried it but the merge API (v3) did not work when the compare branch is in a fork (ie. base repo and compare repo are different).
I have this same issue. I have an automerge script whose job is to bring a PR up to date (by merging master into it), wait for continuous integration to finish, then merge. The first step of this process cannot be done via the API when the branch lives in a fork that I don't have edit rights on, because the merge is refused. The main benefit of the "update branch" button is that it bypasses this requirement.
Because there's no "merge master into X [with implicit permission to do so due to opening a PR involving X]" action in the API, the automerge script has to fallback to the much less convenient strategy of pretend to be a human logging in and clicking on the button via the web page. This is by far the most brittle part of the script; it requires dealing with details like two factor authentication and session expiration. So it would be very beneficial to me if the API just supported this use case.
I'm running into the exact same issue. I have a bot that automates the process of doing pull request checks before catching up and merging. Right now in order to catch up a pull request I have to spin up a headless browser instance and click the "Update Branch" button which isn't ideal.
Would love to see this functionality implemented in the API.
Activity
oprogramador commentedon Apr 13, 2019
I think it should be possible in the API.
Update branchjust means merge the compare branch to the base branch.mspiegel commentedon Apr 14, 2019
Strilanc commentedon Jun 18, 2019
I have this same issue. I have an automerge script whose job is to bring a PR up to date (by merging master into it), wait for continuous integration to finish, then merge. The first step of this process cannot be done via the API when the branch lives in a fork that I don't have edit rights on, because the merge is refused. The main benefit of the "update branch" button is that it bypasses this requirement.
Because there's no "merge master into X [with implicit permission to do so due to opening a PR involving X]" action in the API, the automerge script has to fallback to the much less convenient strategy of pretend to be a human logging in and clicking on the button via the web page. This is by far the most brittle part of the script; it requires dealing with details like two factor authentication and session expiration. So it would be very beneficial to me if the API just supported this use case.
underGhost commentedon Feb 19, 2020
I'm running into the exact same issue. I have a bot that automates the process of doing pull request checks before catching up and merging. Right now in order to catch up a pull request I have to spin up a headless browser instance and click the "Update Branch" button which isn't ideal.
Would love to see this functionality implemented in the API.
arturdryomov commentedon Feb 19, 2020
Um, am I missing something? Seems like it’s available via the API (announce).
underGhost commentedon Feb 19, 2020
@arturdryomov Yup looks like this does the trick! Thanks so much!