diff options
-rw-r--r-- | aports-ghpr.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/aports-ghpr.go b/aports-ghpr.go index 1d5eaf0..67d6f94 100644 --- a/aports-ghpr.go +++ b/aports-ghpr.go @@ -8,7 +8,6 @@ import ( "log" "os" "path" - "strings" ) var ( @@ -56,16 +55,14 @@ func main() { ListOptions: github.ListOptions{PerPage: 200}, } for { - prs, resp, err := client.PullRequests.List(ctx, *owner, *repo, opt) + query := fmt.Sprintf("%s type:pr in:title is:open repo:%s/%s", aport, *owner, *repo) + + res, resp, err := client.Search.Issues(ctx, query, nil) if err != nil { log.Fatal(err) } - for _, pr := range prs { - if aport != "" && !strings.Contains(*pr.Title, aport) { - continue - } - - fmt.Println(*pr.Number, *pr.User.Login, *pr.HTMLURL, *pr.Title) + for _, issue := range res.Issues { + fmt.Println(*issue.Number, *issue.User.Login, *issue.HTMLURL, *issue.Title) } if resp.NextPage == 0 { break |