How can I find how many of my GitHub pull requests have been accepted?
Asked Answered
A

5

14

Is there a way to find out the acceptance rate of one's GitHub PR's, probably using the API?

While at that, it would be interesting to find out how many of the issues I reported have been closed vs. are still open, across all repos.

Apocopate answered 12/2, 2014 at 4:36 Comment(0)
A
9

You can also use GraphQL API v4 to use a single request to get total number of issues, PR with count per state (CLOSED, OPENED or MERGED) :

{
  user(login: "bertrandmartel") {
    totalPR: pullRequests {
      totalCount
    }
    openedPR: pullRequests(states: OPEN) {
      totalCount
    }
    closedPR: pullRequests(states: CLOSED) {
      totalCount
    }
    mergedPR: pullRequests(states: MERGED) {
      totalCount
    }
    totalIssues: issues {
      totalCount
    }
    openedIssues: issues(states: OPEN) {
      totalCount
    }
    closedIssues: issues(states: CLOSED) {
      totalCount
    }
  }
}

Try it in the explorer

which gives you a result like the following :

{
  "data": {
    "user": {
      "totalPR": {
        "totalCount": 17
      },
      "openedPR": {
        "totalCount": 4
      },
      "closedPR": {
        "totalCount": 1
      },
      "mergedPR": {
        "totalCount": 12
      },
      "totalIssues": {
        "totalCount": 80
      },
      "openedIssues": {
        "totalCount": 7
      },
      "closedIssues": {
        "totalCount": 73
      }
    }
  }
}
Arouse answered 27/11, 2017 at 21:31 Comment(0)
H
7

2023 GitHub New Design Update

With the recent implementation of the new GitHub UI, locating all the Pull Requests assigned to you has become effortless. Simply navigate to your profile and utilize the designated button to access them.

enter image description here

For your convenience, you can easily replace YOUR_GITHUB_USERNAME with your GitHub username when using the following link:

https://github.com/pulls?q=is%3Apr+archived%3Afalse+author%3AYOUR_GITHUB_USERNAME

Hostile answered 22/6, 2023 at 9:38 Comment(2)
You can use github.com/pulls?q=is%3Apr+archived%3Afalse+author%3A%40me to view your own PRs without needing to replace your own username in the link.Lithe
This should be an answer.Luscious
M
3

I don't see a way to get that information directly. That leaves you with the GitHub Issues Events API.
With that, you can list all the events of a repo:

GET /repos/:owner/:repo/issues/events
https://api.github.com/repos/user/reponame/issues/events

And filter on a user and an event (looking for "merged": true)

Maladjusted answered 12/2, 2014 at 6:58 Comment(0)
E
3

Certainly there is an indirect way to know your all accepted PR requests and that is GitHub resume. Yes, GitHub resume is something which generates resume of users on the basis of their GitHub activity.

So, go and star the project https://github.com/resume/resume.github.com and then visit http://resume.github.io. There you will see list of your all accepted PR requests.

Note: You need to star the project first, they don't allow to generate the resume otherwise.

Evergreen answered 13/4, 2017 at 11:10 Comment(1)
I think it's showing a list of popular repositories only (not list of PRs). By the way it's "star" the project (not "start")Amick
R
3

Login your GitHub

Then visit - https://github.com/pulls

Click on the closed section.

You will see all the past PRs.

In case you want to check how many of them are merged and how many are closed, simply use the Crtl+F or Find option in your browser and then type merged/closed according to your requirement.

Rescue answered 23/10, 2023 at 13:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.