Skip to content

Find, verify, and analyze leaked credentials

use Repositories field from conn. (#1860)

ahrav3d2490ca80f4
diff --git a/pkg/sources/github/github.go b/pkg/sources/github/github.go
index 63e9b89bf..656a58f98 100644
--- a/pkg/sources/github/github.go
+++ b/pkg/sources/github/github.go
@@ -222,7 +222,7 @@ func (s *Source) Init(aCtx context.Context, name string, jobID sources.JobID, so
}
s.conn = &conn
- s.filteredRepoCache = s.newFilteredRepoCache(memory.New(), s.conn.IncludeRepos, s.conn.IgnoreRepos)
+ s.filteredRepoCache = s.newFilteredRepoCache(memory.New(), s.conn.GetRepositories(), s.conn.GetIgnoreRepos())
s.memberCache = make(map[string]struct{})
s.repoSizes = newRepoSize()
diff --git a/pkg/sources/github/github_test.go b/pkg/sources/github/github_test.go
index 3dd03a0f6..8b5fd27e1 100644
--- a/pkg/sources/github/github_test.go
+++ b/pkg/sources/github/github_test.go
@@ -78,7 +78,7 @@ func TestAddReposByOrg(t *testing.T) {
Credential: &sourcespb.GitHub_Token{
Token: "super secret token",
},
- IncludeRepos: nil,
+ Repositories: nil,
IgnoreRepos: []string{"secret/super-*-repo2"},
})
// gock works here because github.NewClient is using the default HTTP Transport
@@ -106,7 +106,7 @@ func TestAddReposByOrg_IncludeRepos(t *testing.T) {
Credential: &sourcespb.GitHub_Token{
Token: "super secret token",
},
- IncludeRepos: []string{"secret/super*"},
+ Repositories: []string{"secret/super*"},
Organizations: []string{"super-secret-org"},
})
// gock works here because github.NewClient is using the default HTTP Transport