diff --git a/pkg/sources/github/github.go b/pkg/sources/github/github.go index 5a52ef0a838d..d4044f43cf9c 100644 --- a/pkg/sources/github/github.go +++ b/pkg/sources/github/github.go @@ -57,7 +57,6 @@ type Source struct { jobID sources.JobID verify bool repos []string - members []string orgsCache cache.Cache filteredRepoCache *filteredRepoCache memberCache map[string]struct{} @@ -632,7 +631,7 @@ func (s *Source) enumerateWithToken(ctx context.Context, apiEndpoint, token stri } if s.conn.ScanUsers { - s.log.Info("Adding repos", "members", len(s.members), "orgs", s.orgsCache.Count()) + s.log.Info("Adding repos", "members", len(s.memberCache), "orgs", s.orgsCache.Count()) s.addReposForMembers(ctx) return nil } @@ -702,8 +701,8 @@ func (s *Source) enumerateWithApp(ctx context.Context, apiEndpoint string, app * if err != nil { return nil, err } - s.log.Info("Scanning repos", "org_members", len(s.members)) - for _, member := range s.members { + s.log.Info("Scanning repos", "org_members", len(s.memberCache)) + for member := range s.memberCache { logger := s.log.WithValues("member", member) if err := s.getReposByUser(ctx, member); err != nil { logger.Error(err, "error fetching gists by user") @@ -877,7 +876,7 @@ func (s *Source) handleRateLimit(errIn error, res *github.Response) bool { } func (s *Source) addReposForMembers(ctx context.Context) { - s.log.Info("Fetching repos from members", "members", len(s.members)) + s.log.Info("Fetching repos from members", "members", len(s.memberCache)) for member := range s.memberCache { if err := s.addUserGistsToCache(ctx, member); err != nil { s.log.Info("Unable to fetch gists by user", "user", member, "error", err)