GitHub Api check number of approvals on protected branch

I’m writing a server that should connect to GitHub and merge pull requests, but only if the required number of approvals is met.

For my purpose it’s not good enough to automatically merge the branch, I need to be able to track and record the number of approvers before merging.

  • Two profiles on development tools (work and home)
  • Does the Git version that ships with GitHub not have the alias feature?
  • How to build libssh2 for arm64 bit support iOS
  • Git not picking up the correct key according to .ssh/config
  • Is there a way to retrieve eclipse executed git commands?
  • Where can I find for the location of the repos managed by Gitosis in Linux
  • The github API for pull requests page provides a lot of detail, but doesnt have the number of approvers for a pull request on a protected branch. Is this number accessible somewhere? Is there another site out there that does have this kind of API hook?

  • Best way for automated script to determine whether git is really installed on OS X
  • Copy directory from another branch
  • git fast-forward one commit
  • Rename branch on github website?
  • Git Local Repository All Steps
  • How to diff two local repositories
  • One Solution collect form web for “GitHub Api check number of approvals on protected branch”

    doesnt have the number of approvers for a pull request on a protected branch.

    You can get the number by calling the list-reviews-on-a-pull-request endpoint and counting each review where state is APPROVED.

    This, however, doesn’t include the ability to require more than one approved reviews. The current implementation of Reviews (as of Feburary 2017) will allow merging if there is one review that is status approved and none that request changes.

    Reviewing using Integrations

    The simplest solution is to use some 3rd party integration like ReviewNinja to provide Reviews. ReviewNinja has the ability to require multiple approvals but is no longer being actively developed, requires hosting the service yourself, and takes the developer outside of the pull request.

    You can always roll your own solution and control merging using the Status Checks.

    Controlling merges using branch restrictions

    Some workflows restrict who can merge code into protected branches using branch restrictions. If you know a group of users or team are required to merge, then you may be able to work around the limitation not being able to require multiple users. Rather, the user that merges the code implicitly approves the code.

    Git Baby is a git and github fan, let's start git clone.