Skip to content

Commit fb4f990

Browse files
Only fetch open PR's
1 parent b1e8723 commit fb4f990

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/utils/github.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ func (c *GithubClient) connect(ctx context.Context) error {
5959
log.Fatal("Failed to initialize OAuth2 client")
6060
}
6161

62-
c.client = github.NewClient(tc)
63-
if c.client == nil {
62+
client := github.NewClient(tc)
63+
if client == nil {
6464
log.Fatalf("Failed to initialize GitHub client")
6565
}
66+
c.client = client
6667

6768
log.Printf("Initialized GitHub client")
6869
return nil
@@ -75,7 +76,7 @@ func (c *GithubClient) ListPullRequests(ctx context.Context, repoName, repoOwner
7576
log.Printf("Fetching PRs for %s/%s", repoOwner, repoName)
7677
// fetch PR's by page
7778
opts := &github.PullRequestListOptions{
78-
State: "all",
79+
State: "open",
7980
ListOptions: github.ListOptions{Page: 0, PerPage: 30},
8081
}
8182

0 commit comments

Comments
 (0)