octokit / octokit.net

A GitHub API client library for .NET
https://octokitnet.readthedocs.io/en/latest/
MIT License
2.62k stars 1.07k forks source link

[BUG]: Accessing Pull Requests from all GHE Org Repos (internal included) #2897

Open dorf8839 opened 1 month ago

dorf8839 commented 1 month ago

What happened?

I'm currently able to pull PRs from all public and private repos of my GHE organization but the request for a PR from an internal repo always comes back with a 404 status code. I'm using the PullRequest.Get() method for the request. For my Github App, I'm requesting the following permissions:

I'm generating a token using the ID and Secret from the App, and then use the access token in the Credentials object when creating the client. I've tried specifying different AuthenticationType enum values in the Credentials object as well but without luck. I've also attempted to retrieve all repos from the organization but none of the internal repos are returned.

In the OauthLoginRequest I'm requesting { "read:user", "repo", "pull_requests:read" }. I've tried it both with and without the last scope listed, as I believe that one might be specific to calling the REST endpoints, as well as with no scopes listed.

When I get my OAuthToken from the Oauth.CreateAccessToken() method, the OAuthToken.Scope value is a string array but the only value is an empty string. I'm not sure why that wouldn't be returning the scopes listed in the OauthLoginRequest though.

Any and all help is greatly appreciated. Thank you!

Versions

Octokit v9.1.0

Relevant log output

Octokit.NotFoundException: 'Not Found'

Code of Conduct