exclude-forks gitlab and github

This commit is contained in:
zricethezav committed 2020-01-19 12:35:52 -05:00
1 parent b47e00858e
commit 1afa931248
4 files changed
+22 -5

No files matched your search

+9 -1
View File
@@ -72,7 +72,15 @@ func (g *Github) Audit() {
_githubRepos, resp, err = g.client.Repositories.ListByOrg(ctx, g.manager.Opts.Organization,
&github.RepositoryListByOrgOptions{ListOptions: listOptions})
}
githubRepos = append(githubRepos, _githubRepos...)
for _, r := range _githubRepos {
if g.manager.Opts.ExcludeForks && r.GetFork() {
log.Debugf("excluding forked repo: %s", *r.Name)
continue
}
githubRepos = append(githubRepos, r)
}
if resp == nil {
break