@@ -138,12 +138,22 @@ func resolveStartRef(ctx context.Context, gh *github.Client, owner, repo, start
138138// pullRequestsBetween finds all pull requests merged between start and end by
139139// walking the commit comparison and querying PRs for each commit.
140140func pullRequestsBetween (ctx context.Context , gh * github.Client , owner , repo , start , end string ) map [int ]* github.PullRequest {
141- cmp , _ , err := gh .Repositories .CompareCommits (ctx , owner , repo , start , end , nil )
142- if err != nil {
143- log .Fatalf ("compare commits: %v" , err )
141+ var allCommits []* github.RepositoryCommit
142+ opts := & github.ListOptions {PerPage : 100 }
143+ for {
144+ cmp , resp , err := gh .Repositories .CompareCommits (ctx , owner , repo , start , end , opts )
145+ if err != nil {
146+ log .Fatalf ("compare commits: %v" , err )
147+ }
148+ allCommits = append (allCommits , cmp .Commits ... )
149+ if resp .NextPage == 0 {
150+ break
151+ }
152+ opts .Page = resp .NextPage
144153 }
154+
145155 prsMap := make (map [int ]* github.PullRequest )
146- for _ , c := range cmp . Commits {
156+ for _ , c := range allCommits {
147157 prs , _ , err := gh .PullRequests .ListPullRequestsWithCommit (ctx , owner , repo , c .GetSHA (), nil )
148158 if err != nil {
149159 log .Printf ("list PRs for commit %s: %v" , c .GetSHA (), err )
0 commit comments