I am attempting to list all repositories (private and public) for an installed GitHub app using the client.Repositories.List() function.
Problem: It is only returning public repositories. Not private ones, which the app has permission to access.
tr:=http.DefaultTransport//using ghinstallation for authitr, err:=ghinstallation.NewKeyFromFile(tr, viper.GetInt64("APP_ID"), installationid, viper.GetString("KEY_PATH"))
iferr!=nil {
log.Fatal("Error Generating new GitHub key from file: ", err)
}
client:=github.NewClient(&http.Client{Transport: itr})
// Make the call to list repositoriesopt:=&github.RepositoryListOptions{Type: "all"}
orgs, resp, err=newclient.Repositories.List(ctx, p.Org, opt)I have even tried the following:
- using
.WithAuthToken() instead of ghinstallation library - Using the token to make a raw HTTP call, not using the
go-github library.
No matter what, it won't return private repos in the list. Could it be a GitHub API problem? The Installation token that is generated is legitimate, and actually allows me to clone repositories.
Any help would be massively appreciated. I feel like I'm taking crazy pills 😆
I am attempting to list all repositories (private and public) for an installed GitHub app using the
client.Repositories.List()function.Problem: It is only returning public repositories. Not private ones, which the app has permission to access.
I have even tried the following:
.WithAuthToken()instead of ghinstallation librarygo-githublibrary.No matter what, it won't return private repos in the list. Could it be a GitHub API problem? The Installation token that is generated is legitimate, and actually allows me to clone repositories.
Any help would be massively appreciated. I feel like I'm taking crazy pills 😆