Skip to content

Find, verify, and analyze leaked credentials

Fix improper github org member pagination (#814)

trufflesteeeve63fcf33ce683
diff --git a/pkg/sources/github/github.go b/pkg/sources/github/github.go
index 62d5ed045..9c74730f4 100644
--- a/pkg/sources/github/github.go
+++ b/pkg/sources/github/github.go
@@ -788,16 +788,15 @@ func (s *Source) addOrgsByUser(ctx context.Context, user string) {
}
func (s *Source) addMembersByOrg(ctx context.Context, org string) error {
- opts := &github.ListOptions{
- PerPage: membersAppPagination,
- }
- optsOrg := &github.ListMembersOptions{
- PublicOnly: false,
- ListOptions: *opts,
+ opts := &github.ListMembersOptions{
+ PublicOnly: false,
+ ListOptions: github.ListOptions{
+ PerPage: membersAppPagination,
+ },
}
for {
- members, res, err := s.apiClient.Organizations.ListMembers(ctx, org, optsOrg)
+ members, res, err := s.apiClient.Organizations.ListMembers(ctx, org, opts)
if err == nil {
defer res.Body.Close()
}