I tried to use the number of committers who merged pull requests into the master branch. However, I cannot consider the reject action.
In GitHub, is there a way I can see the number of collaborators within someone else's repository?
The GitHub API v3 has an endpoint for listing collaborators:
GET /repos/:owner/:repo/collaborators
To use it, you need to authenticate, and you have to be one of those collaborators or you'd see this:
{
"message": "Must have push access to view repository collaborators.",
"documentation_url": "https://developer.github.com/v3"
}
I've noticed that when you go to the Issues section of a repository and filter by author or assignee, you get a drop-down listing the repository's collaborators. The HTML content of this drop-down is loaded on demand, in a separate GET request, for example:
https://github.com/Leaflet/Leaflet/issues/show_menu_content?partial=issues/filters/authors_content
I had a similar need. So, i went and found the details of all PushEvent, CreateEvent and PullRequestEvent made on the master branch of the repository from githubarchive database hosted on google bigquery. From this, I could get a conservative estimate of all the users who are collaborators. Every PullRequestEvent that is merged results in a push event with the name of the collaborator who merged the request. However, if a PullRequestEvent is rejected, I had to look at who closed the PullRequest and if it is not the user that originally created the pull request then that person is also a collaborator. I am not sure if this is the best way to do this, but this is all I could think off.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With