Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ee112b

Browse files
authored
fix: Fetch all GitHub teams on login (#2951)
This wasn't looping prior, so organizations with >100 teamscouldn't login. Contributes to#2848.
1 parent59facdd commit5ee112b

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

‎cli/server.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,23 @@ func configureGithubOAuth2(accessURL *url.URL, clientID, clientSecret string, al
771771
returnmemberships,err
772772
},
773773
ListTeams:func(ctx context.Context,client*http.Client,orgstring) ([]*github.Team,error) {
774-
teams,_,err:=github.NewClient(client).Teams.ListTeams(ctx,org,&github.ListOptions{
774+
opt:=&github.ListOptions{
775+
// This is the maximum amount per-page that GitHub allows.
775776
PerPage:100,
776-
})
777-
returnteams,err
777+
}
778+
varallTeams []*github.Team
779+
for {
780+
teams,resp,err:=github.NewClient(client).Teams.ListTeams(ctx,org,opt)
781+
iferr!=nil {
782+
returnnil,err
783+
}
784+
allTeams=append(allTeams,teams...)
785+
ifresp.NextPage==0 {
786+
break
787+
}
788+
opt.Page=resp.NextPage
789+
}
790+
returnallTeams,nil
778791
},
779792
},nil
780793
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp