Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find pull requests merged by a specific user

Tags:

github

Is it possible to filter pull requests in github by who merged it?

Something like:

is:merged is:pr mergedBy:username

but that doesn't work

EDIT: This was what i came up with (my goal was to create a top list of most active codereviewers in our project):

var result = {};
$.get("/api/v3/repos/atg/atgse/pulls?state=closed&per_page=100", function(pulls){
    pulls.forEach(function(listPullItem){
        $.get(listPullItem.url, function(pull) {
            if (pull && pull.merged_by) {
                result[pull.merged_by.login] = result[pull.merged_by.login] || 0;
                result[pull.merged_by.login] ++;
            }
        });
    });
});
like image 204
martin Avatar asked Mar 26 '15 11:03

martin


1 Answers

Since it doesn't seem to be available directly through the GitHub search filters, you would need to list the pull request with the GitHub API, and select only the ones with the merged_by.login you want.
You have an example in this coffee script which is able to parse the JSON answer and iterate through the pull request entries.

like image 77
VonC Avatar answered Sep 23 '22 19:09

VonC