| 176 | } |
| 177 | |
| 178 | func (c *GithubConfig) discoverRepos(page int) ([]*github.Repository, *github.Response, error) { |
| 179 | affiliations := make([]string, 0) |
| 180 | |
| 181 | if *c.Owned { |
| 182 | affiliations = append(affiliations, "owner") |
| 183 | } |
| 184 | if *c.Collaborator { |
| 185 | affiliations = append(affiliations, "collaborator") |
| 186 | } |
| 187 | if *c.OrgMember { |
| 188 | affiliations = append(affiliations, "organization_member") |
| 189 | } |
| 190 | |
| 191 | if len(affiliations) == 0 { |
| 192 | return make([]*github.Repository, 0), &github.Response{}, nil |
| 193 | } |
| 194 | |
| 195 | return c.client.Repositories.List(context.Background(), "", &github.RepositoryListOptions{ |
| 196 | ListOptions: github.ListOptions{ |
| 197 | Page: page, |
| 198 | PerPage: 100, |
| 199 | }, |
| 200 | Affiliation: strings.Join(affiliations, ","), |
| 201 | }) |
| 202 | } |
| 203 | |
| 204 | func (c *GithubConfig) getStarredRepos(page int) ([]*github.Repository, *github.Response, error) { |
| 205 | starred, response, err := c.client.Activity.ListStarred(context.Background(), "", &github.ActivityListStarredOptions{ |