Skip to content

Find, verify, and analyze leaked credentials

chore(github): reduce comment log verbosity (#1922)

Richard Gomez3acc65b2fbbb
diff --git a/pkg/sources/github/github.go b/pkg/sources/github/github.go
index 628b0a104..80eb29bb2 100644
--- a/pkg/sources/github/github.go
+++ b/pkg/sources/github/github.go
@@ -1089,7 +1089,7 @@ func (s *Source) scanComments(ctx context.Context, repoPath string, chunksChan c
}
func (s *Source) processGistComments(ctx context.Context, repoPath string, trimmedURL []string, repoURL *url.URL, chunksChan chan *sources.Chunk) error {
- s.log.Info("scanning github gist comments", "repository", repoPath)
+ ctx.Logger().V(2).Info("scanning github gist comments", "repository", repoPath)
// GitHub Gist URL.
gistID, err := extractGistID(trimmedURL)
if err != nil {
@@ -1170,19 +1170,21 @@ func (s *Source) processRepoComments(ctx context.Context, repoPath string, trimm
}
if s.includeIssueComments {
- if err := s.processIssueComments(ctx, repoInfo, chunksChan); err != nil {
+ ctx.Logger().V(2).Info("scanning github issues", "repository", repoInfo.repoPath)
+ if err := s.processIssues(ctx, repoInfo, chunksChan); err != nil {
return err
}
- if err := s.processIssues(ctx, repoInfo, chunksChan); err != nil {
+ if err := s.processIssueComments(ctx, repoInfo, chunksChan); err != nil {
return err
}
}
if s.includePRComments {
- if err := s.processPRComments(ctx, repoInfo, chunksChan); err != nil {
+ ctx.Logger().V(2).Info("scanning github pull requests", "repository", repoInfo.repoPath)
+ if err := s.processPRs(ctx, repoInfo, chunksChan); err != nil {
return err
}
- if err := s.processPRs(ctx, repoInfo, chunksChan); err != nil {
+ if err := s.processPRComments(ctx, repoInfo, chunksChan); err != nil {
return err
}
}
@@ -1192,8 +1194,6 @@ func (s *Source) processRepoComments(ctx context.Context, repoPath string, trimm
}
func (s *Source) processIssues(ctx context.Context, info repoInfo, chunksChan chan *sources.Chunk) error {
- s.log.Info("scanning github issue descriptions", "repository", info.repoPath)
-
bodyTextsOpts := &github.IssueListByRepoOptions{
Sort: sortType,
Direction: directionType,
@@ -1228,8 +1228,6 @@ func (s *Source) processIssues(ctx context.Context, info repoInfo, chunksChan ch
}
func (s *Source) processIssueComments(ctx context.Context, info repoInfo, chunksChan chan *sources.Chunk) error {
- s.log.Info("scanning github issue comments", "repository", info.repoPath)
-
issueOpts := &github.IssueListCommentsOptions{
Sort: &sortType,
Direction: &directionType,
@@ -1263,8 +1261,6 @@ func (s *Source) processIssueComments(ctx context.Context, info repoInfo, chunks
}
func (s *Source) processPRs(ctx context.Context, info repoInfo, chunksChan chan *sources.Chunk) error {
- s.log.Info("scanning github pull request descriptions", "repository", info.repoPath)
-
prOpts := &github.PullRequestListOptions{
Sort: sortType,
Direction: directionType,
@@ -1299,8 +1295,6 @@ func (s *Source) processPRs(ctx context.Context, info repoInfo, chunksChan chan
}
func (s *Source) processPRComments(ctx context.Context, info repoInfo, chunksChan chan *sources.Chunk) error {
- s.log.Info("scanning github pull request comments", "repository", info.repoPath)
-
prOpts := &github.PullRequestListCommentsOptions{
Sort: sortType,
Direction: directionType,