简体   繁体   中英

How to I get all open pull requests opened by my user with github api?

How to I get all open pull requests opened by my user with github api?

Am looking to get these from Python but as long REST calls can do it, I am fine.

Keep in mind that I do want all PRs from all repositories owned by me. After this I will also want to get all open PRs where I was asked to be a reviewer (those that I need to review).

You can use GitHub API /pulls endpoint to fetch a user's Pull Requests.

But in short, you can use this URL

GET /repos/:owner/:repo/pulls?head=user:{USERNAME-HERE}

For private repositories, you need to authenticate yourself first. https://developer.github.com/v3/#authentication

And lastly, to list all pull requests which you are a reviewer, take a look at this . There is no direct way to list all pull requests waiting for review from you but first, you can list all pull requests and later filter them.

GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM