@@ -24,7 +24,7 @@ const fragment = `fragment pr on PullRequest {
2424}`
2525
2626func listPullRequests (httpClient * http.Client , repo ghrepo.Interface , filters prShared.FilterOptions , limit int ) (* api.PullRequestAndTotalCount , error ) {
27- if filters .Author != "" || filters .Assignee != "" || filters .Search != "" {
27+ if filters .Author != "" || filters .Assignee != "" || filters .Search != "" || len ( filters . Labels ) > 0 {
2828 return searchPullRequests (httpClient , repo , filters , limit )
2929 }
3030
@@ -48,14 +48,12 @@ func listPullRequests(httpClient *http.Client, repo ghrepo.Interface, filters pr
4848 $limit: Int!,
4949 $endCursor: String,
5050 $baseBranch: String,
51- $labels: [String!],
5251 $state: [PullRequestState!] = OPEN
5352 ) {
5453 repository(owner: $owner, name: $repo) {
5554 pullRequests(
5655 states: $state,
5756 baseRefName: $baseBranch,
58- labels: $labels,
5957 first: $limit,
6058 after: $endCursor,
6159 orderBy: {field: CREATED_AT, direction: DESC}
@@ -74,9 +72,8 @@ func listPullRequests(httpClient *http.Client, repo ghrepo.Interface, filters pr
7472
7573 pageLimit := min (limit , 100 )
7674 variables := map [string ]interface {}{
77- "owner" : repo .RepoOwner (),
78- "repo" : repo .RepoName (),
79- "labels" : filters .Labels ,
75+ "owner" : repo .RepoOwner (),
76+ "repo" : repo .RepoName (),
8077 }
8178
8279 switch filters .State {
@@ -135,10 +132,6 @@ loop:
135132}
136133
137134func searchPullRequests (httpClient * http.Client , repo ghrepo.Interface , filters prShared.FilterOptions , limit int ) (* api.PullRequestAndTotalCount , error ) {
138- if len (filters .Labels ) > 1 {
139- return nil , fmt .Errorf ("multiple labels with --assignee are not supported" )
140- }
141-
142135 type response struct {
143136 Search struct {
144137 Nodes []api.PullRequest
@@ -189,8 +182,8 @@ func searchPullRequests(httpClient *http.Client, repo ghrepo.Interface, filters
189182 if filters .Assignee != "" {
190183 q .AssignedTo (filters .Assignee )
191184 }
192- if len ( filters .Labels ) > 0 {
193- q .AddLabel (filters . Labels [ 0 ] )
185+ for _ , label := range filters .Labels {
186+ q .AddLabel (label )
194187 }
195188 if filters .BaseBranch != "" {
196189 q .SetBaseBranch (filters .BaseBranch )
0 commit comments