Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

"Update Branch" button not available in API #1523

Open

Description

@mspiegel

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.

Activity

  1. added
    API
    on Mar 17, 2019
  2. oprogramador commented on Apr 13, 2019

    @oprogramador

    I think it should be possible in the API. Update branch just means merge the compare branch to the base branch.

  3. mspiegel commented on Apr 14, 2019

    @mspiegel
    Author
  4. Strilanc commented on Jun 18, 2019

    @Strilanc

    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.

  5. underGhost commented on Feb 19, 2020

    @underGhost

    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.

  6. arturdryomov commented on Feb 19, 2020

    @arturdryomov

    Um, am I missing something? Seems like it’s available via the API (announce).

  7. underGhost commented on Feb 19, 2020

    @underGhost

    @arturdryomov Yup looks like this does the trick! Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIforksmerge

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions