mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 15:14:38 +00:00
chore(github): reduce comment log verbosity (#1922)
This commit is contained in:
parent
4cb67a571d
commit
3acc65b2fb
1 changed files with 7 additions and 13 deletions
|
@ -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 {
|
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.
|
// GitHub Gist URL.
|
||||||
gistID, err := extractGistID(trimmedURL)
|
gistID, err := extractGistID(trimmedURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1170,19 +1170,21 @@ func (s *Source) processRepoComments(ctx context.Context, repoPath string, trimm
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.includeIssueComments {
|
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
|
return err
|
||||||
}
|
}
|
||||||
if err := s.processIssues(ctx, repoInfo, chunksChan); err != nil {
|
if err := s.processIssueComments(ctx, repoInfo, chunksChan); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.includePRComments {
|
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
|
return err
|
||||||
}
|
}
|
||||||
if err := s.processPRs(ctx, repoInfo, chunksChan); err != nil {
|
if err := s.processPRComments(ctx, repoInfo, chunksChan); err != nil {
|
||||||
return err
|
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 {
|
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{
|
bodyTextsOpts := &github.IssueListByRepoOptions{
|
||||||
Sort: sortType,
|
Sort: sortType,
|
||||||
Direction: directionType,
|
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 {
|
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{
|
issueOpts := &github.IssueListCommentsOptions{
|
||||||
Sort: &sortType,
|
Sort: &sortType,
|
||||||
Direction: &directionType,
|
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 {
|
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{
|
prOpts := &github.PullRequestListOptions{
|
||||||
Sort: sortType,
|
Sort: sortType,
|
||||||
Direction: directionType,
|
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 {
|
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{
|
prOpts := &github.PullRequestListCommentsOptions{
|
||||||
Sort: sortType,
|
Sort: sortType,
|
||||||
Direction: directionType,
|
Direction: directionType,
|
||||||
|
|
Loading…
Reference in a new issue