-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
good first issueGood for newcomersGood for newcomershacktoberfestHelp wanted for hacktoberfestHelp wanted for hacktoberfesthelp wantedExtra attention is neededExtra attention is needed
Description
Currently in the code base we fetch the repositories for a user or an organization with the following respectively
opt := &github.RepositoryListOptions{Type: "all"}
...
var repos, resp, err = client.Repositories.List(ctx, *githubUser, opt)
and
opt := &github.RepositoryListByOrgOptions{Type: "all"}
...
var repos, resp, err = client.Repositories.ListByOrg(ctx, *githubOrg, opt)
And when we want to exclude things such as forks,private, archived or disabled repos we simply pass over them in our evaluation
if *repo.Archived == true {
loggerWithFields.Info("skipping archived")
continue
}
if *repo.Disabled == true {
loggerWithFields.Info("skipping disabled")
continue
}
if *includeForks == false {
if *repo.Fork == true {
loggerWithFields.Info("skipping fork")
continue
}
}
if *includePrivate == false {
if *repo.Private == true {
loggerWithFields.Info("skipping private")
continue
}
}
The GitHub API supports changing the types in the options that are declared above as shown in their documentation https://developer.github.com/v3/repos/#list-repositories-for-the-authenticated-user
This would be a good issue if someone wanted to investigate this and see if they can instead modify the opts variable with the appropriate string to prevent us from getting unnecessary repos.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershacktoberfestHelp wanted for hacktoberfestHelp wanted for hacktoberfesthelp wantedExtra attention is neededExtra attention is needed