Reputation: 1526
For my team's weekly builds, I go through all pull requests from the company GitHub and pull out the PRs associated to my team. This requires an annoying sieving step that requires a walk-through of the company's previous week of code contribution.
I looked at the official GitHub search documentation (HERE) and found the "author" field could be used to narrow down the search in the way I want, but when I try this at https://github.com/pulls it only works on one author at a time.
Is there a way to search across a list of authors?
For a little extra context, my team operates across a large list of repos, all of which are under a blanket organization which houses all repos across the company.
Upvotes: 91
Views: 74848
Reputation: 10396
Go to this page: https://github.com/search/advanced
Apply the filters like below:
In the results page, use the side panel filter for Pull Requests.
Upvotes: 3
Reputation: 445
This is a very similar problem that I have encountered before. To solve this problem I captured webhooks from GitHub into a database. I know this is a "larger" solution than directly querying GitHub, but I think it is more maintainable.
If you are interested I wrote up the whole process here. In this article, I use Visivo (which I helped write) to accomplish the dashboarding. It is a developer-friendly open-source CLI for creating charts. Your change would require a trivial addition to the query of an IN (names)
to the base query.
If you are interested, and there are additional charts you would find valuable as part of the GitHub dashboard, you can open up an issue on the dashboard repo here.
A big benefit of capturing the data is that you can write additional queries very quickly.
Upvotes: 1
Reputation: 8078
author:*
with your usernames.
Explained
is:pr
- only PRs (since Github treats Issues and PRs both as "Issues")repo:
- only show PRs in that repoauthor:
- only show PRs for these authorsIt shows as "Issues", but the list will only include PRs.
You can modify the query params in the following URL to have the list of people on your team.
<username1,2,3,4>
with your teammates Github username's.https://github.<your_company>.com/search?q=author%3A<username1>+author%3A<username2>+author%3A<username3>+author%3A<username4>+is%3Apr&type=Issues
You can use Github's "Advanced Search" to achieve what you're looking for without needing to learn Github's query language.
http://github.com/search/advanced
http://github.<your_company>.com/search/advanced
You can use the fields below for filtering:
It uses query params under the hood, so you can generate the search with your UI and copy and paste it (to use for Option 3).
Note: You'll need to add "is:pr" to the resulting search query, no way to do that in the UI.
Upvotes: 5
Reputation: 4951
Make sure that you are using the full search at https://github.com/search.
Then simply add extra author: <name>
fields to your query. The searching engine will OR fields. For example:
is:pr author:username1 author:username2
(Note that this only works on https://github.com/search. The search syntax on other pages, like https://github.com/pulls, is severely limited and does not support searching by multiple authors. If you try the same search on https://github.com/pulls, GitHub will simply ignore all but one author that you list.)
To limit it to repositories by a specific owner, add the user: <owner>
field to the query.
Upvotes: 103
Reputation: 164
Using the route github.com/search instead of github.com/pulls is the "right" answer in some sense, but I like the format of the /pulls page better. When working in a small team my approach is to use /pulls but substitute "involves" for "author", like this (for reference, the same query using /search and "author").
You will get "extra" hits where the author is someone outside the list, but it's another trick to know. (Names in the examples picked at random from recent public PRs)
Upvotes: 13