Closed
Description
Hi I am trying to fetch all the repos (including private ones) including their PRs and Reviews. I am authenticating using my personal access token that has SSO enabled for the organization whose repos I want to fetch. But for some reason it only works for public repos and I dont see any private repos in my results
Here is the code
ctx := context.Background()
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: "my-token"},
)
tc := oauth2.NewClient(ctx, ts)
client := github.NewClient(tc)
prs, _, err := client.PullRequests.List(ctx, "org-name", "private-repo-name", nil)
checkErr(err)
for _, pr := range prs {
fmt.Println(*pr.Title)
}
I get an error saying GET https://api.github.com/repos/org-name/private-repo-name/pulls: 404 Not Found []
if I try to fetch the PRs of a private repo from that org
If however, I try a public repo it works.
I am able to access these repos on github
Am I authenticating my client correctly?
Metadata
Metadata
Assignees
Labels
No labels