Skip to content

Commit 97a7371

Browse files
403 on listing user gist should not fail org scan (#822)
1 parent 752c848 commit 97a7371

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

pkg/sources/github/github.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ func (s *Source) enumerateWithApp(ctx context.Context, apiEndpoint string, app *
337337
log.Infof("Scanning repos from %v organization members.", len(s.members))
338338
for _, member := range s.members {
339339
if err = s.addGistsByUser(ctx, member); err != nil {
340-
return nil, err
340+
log.WithError(err).WithField("member", member).Error("error fetching gists by user")
341341
}
342342
if err := s.addRepos(ctx, member, s.getReposByUser); err != nil {
343343
log.WithError(err).Error("error fetching repos by user")
@@ -622,7 +622,6 @@ func (s *Source) getGistsByUser(ctx context.Context, user string) ([]string, err
622622
continue
623623
}
624624
if err != nil {
625-
log.WithError(err).Warnf("could not list repos for user %s", user)
626625
return nil, fmt.Errorf("could not list repos for user %s: %w", user, err)
627626
}
628627
for _, gist := range gists {
@@ -656,8 +655,7 @@ func (s *Source) addMembersByApp(ctx context.Context, installationClient *github
656655

657656
installs, _, err := installationClient.Apps.ListInstallations(ctx, opts)
658657
if err != nil {
659-
log.WithError(err).Warn("Could not enumerate organizations using user")
660-
return err
658+
return fmt.Errorf("could not enumerate installed orgs: %w", err)
661659
}
662660

663661
for _, org := range installs {

0 commit comments

Comments
 (0)