Skip to content

Find, verify, and analyze leaked credentials

Move Github comments check to fix a test #1927

Cody Rose7ac7fa872818
diff --git a/pkg/sources/github/github.go b/pkg/sources/github/github.go
index 291c75681..628b0a104 100644
--- a/pkg/sources/github/github.go
+++ b/pkg/sources/github/github.go
@@ -1151,10 +1151,6 @@ type repoInfo struct {
}
func (s *Source) processRepoComments(ctx context.Context, repoPath string, trimmedURL []string, repoURL *url.URL, chunksChan chan *sources.Chunk) error {
- if !(s.includeIssueComments || s.includePRComments) {
- return nil
- }
-
// Normal repository URL (https://github.com/<owner>/<repo>).
if len(trimmedURL) < 3 {
return fmt.Errorf("url missing owner and/or repo: '%s'", repoURL.String())
@@ -1162,6 +1158,10 @@ func (s *Source) processRepoComments(ctx context.Context, repoPath string, trimm
owner := trimmedURL[1]
repo := trimmedURL[2]
+ if !(s.includeIssueComments || s.includePRComments) {
+ return nil
+ }
+
repoInfo := repoInfo{
owner: owner,
repo: repo,