From 7da2928e9ab87c6175dfa72d4e5d67ebff4f98b9 Mon Sep 17 00:00:00 2001 From: James Telfer <792299+jamestelfer@users.noreply.github.com> Date: Wed, 25 Oct 2023 23:36:42 +1100 Subject: [PATCH] fix: always include forks in repo search --- internal/scm/github/github.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/scm/github/github.go b/internal/scm/github/github.go index d375e271..12edd677 100755 --- a/internal/scm/github/github.go +++ b/internal/scm/github/github.go @@ -296,7 +296,11 @@ func (g *Github) getSearchRepositories(ctx context.Context, search string) ([]*g i := 1 for { rr, _, err := retry(ctx, func() ([]*github.Repository, *github.Response, error) { - rr, resp, err := g.ghClient.Search.Repositories(ctx, search, &github.SearchOptions{ + // Include forks in the search: these are filtered if needed. We could + // filter in the search but this would not log that the fork had been + // skipped, which is different behaviour to the other types of retrieval. + query := "fork:true " + search + rr, resp, err := g.ghClient.Search.Repositories(ctx, query, &github.SearchOptions{ ListOptions: github.ListOptions{ Page: i, PerPage: 100,