-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Issue Listing Private Repositories for User #2980
Copy link
Copy link
Closed
Description
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 auth
itr, err := ghinstallation.NewKeyFromFile(tr, viper.GetInt64("APP_ID"), installationid, viper.GetString("KEY_PATH"))
if err != nil {
log.Fatal("Error Generating new GitHub key from file: ", err)
}
client := github.NewClient(&http.Client{Transport: itr})
// Make the call to list repositories
opt := &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-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 😆
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels