Skip to content

Commit 29be2f2

Browse files
committed
more
1 parent 38182bd commit 29be2f2

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

pkg/connector/connector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const githubDotCom = "https://github.com"
3131

3232
var (
3333
ValidAssetDomains = []string{"avatars.githubusercontent.com"}
34-
max_page_size int = 100
34+
max_page_size int = 100 // maximum page size github supported.
3535
)
3636

3737
var (
@@ -427,7 +427,7 @@ func getOrgs(ctx context.Context, client *github.Client, orgs []string) ([]strin
427427
orgLogins []string
428428
)
429429
for {
430-
orgs, resp, err := client.Organizations.List(ctx, "", &github.ListOptions{Page: page})
430+
orgs, resp, err := client.Organizations.List(ctx, "", &github.ListOptions{Page: page, PerPage: max_page_size})
431431
if err != nil {
432432
return nil, fmt.Errorf("github-connector: failed to retrieve org: %w", err)
433433
}

pkg/connector/org_role.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ func (o *orgRoleResourceType) Grants(
208208
}
209209
case resourceTypeTeam.Id:
210210
opts := &github.ListOptions{
211-
Page: page,
211+
Page: page,
212+
PerPage: max_page_size,
212213
}
213214
teams, resp, err := o.client.Organizations.ListTeamsAssignedToOrgRole(ctx, orgName, roleID, opts)
214215
if err != nil {

pkg/connector/repository.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ func (o *repositoryResourceType) Grants(
211211

212212
case resourceTypeTeam.Id:
213213
opts := &github.ListOptions{
214-
Page: page,
214+
Page: page,
215+
PerPage: max_page_size,
215216
}
216217
teams, resp, err := o.client.Repositories.ListTeams(ctx, orgName, resource.DisplayName, opts)
217218
if err != nil {

0 commit comments

Comments
 (0)