add include forks option (#37)

This commit is contained in:
Dustin Decker
2022-02-15 18:54:47 -08:00
parent c131a6e4ae
commit 152ef6d4e1
6 changed files with 147 additions and 123 deletions
+9
View File
@@ -378,6 +378,9 @@ func (s *Source) addReposByOrg(ctx context.Context, apiClient *github.Client, or
break
}
for _, r := range someRepos {
if r.GetFork() && !s.conn.IncludeForks {
continue
}
common.AddStringSliceItem(r.GetCloneURL(), &s.repos)
}
if res.NextPage == 0 {
@@ -405,6 +408,9 @@ func (s *Source) addReposByUser(ctx context.Context, apiClient *github.Client, u
break
}
for _, r := range someRepos {
if r.GetFork() && !s.conn.IncludeForks {
continue
}
common.AddStringSliceItem(r.GetCloneURL(), &s.repos)
}
if res.NextPage == 0 {
@@ -501,6 +507,9 @@ func (s *Source) addReposByApp(ctx context.Context, apiClient *github.Client) er
return errors.WrapPrefix(err, "unable to list repositories", 0)
}
for _, r := range someRepos.Repositories {
if r.GetFork() && !s.conn.IncludeForks {
continue
}
common.AddStringSliceItem(r.GetCloneURL(), &s.repos)
}
if res.NextPage == 0 {