Skip to content

Commit

Permalink
fix(terraformpullrequest): fix pagination for github pull request files
Browse files Browse the repository at this point in the history
  • Loading branch information
Julen Dixneuf committed Oct 13, 2023
1 parent 93a6cd3 commit 0d4bf60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/controllers/terraformpullrequest/github/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ func (g *Github) GetChanges(repository *configv1alpha1.TerraformRepository, pr *
return []string{}, err
}
// Per page is 30 by default, max is 100
opts := &github.RepositoryListByOrgOptions{
ListOptions: github.ListOptions{PerPage: 100},
opts := &github.ListOptions{
PerPage: 100,
}
// Get all pull request files from Github
var allChangedFiles []string
for {
changedFiles, resp, err := g.Client.PullRequests.ListFiles(context.TODO(), owner, repoName, id, nil)
changedFiles, resp, err := g.Client.PullRequests.ListFiles(context.TODO(), owner, repoName, id, opts)
if err != nil {
return []string{}, err
}
Expand Down

0 comments on commit 0d4bf60

Please sign in to comment.