403 error: Resource not accessible by integration when forking a private repo we have access to, using the API #178852
Replies: 2 comments
-
Ensure the GitHub App is installed on both the source and destination accounts.
|
Beta Was this translation helpful? Give feedback.
-
|
Yeah, that 403 usually means the app doesn’t have permission to create the fork. Go to the app settings on the destination account, switch it to All repositories and reinstall it. Then try the same API call again you should get a 202 if it worked.If it still fails, test with a personal access token that has the repo scope to double check it’s just a permissions thing.If that fixes it, mark this as helpful so others don’t waste time on the same issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
The docs on Creating a fork with the REST API seem to indicate that the API works with GitHub app user access tokens. However, when I call this API on a private repo, I get 403: Resource not accessible by integration
The App is both:
This appears to agree with the note on the API:
I can create a fork successfully for a public repo that's owned by the organization, so I don't see why you can't do the same for a private repo if the App + user together have sufficient permissions. I feel like I must be doing something wrong.
This question seems similar to this one in 2022, and the resolution there was that there was a limitation in forking a private repo. But a fair amount of time has passed since then, and this is using a user access token, which is different from an app installation—I believe the use case there was forking from one org to another org with an app installation token, not a user access token.
Beta Was this translation helpful? Give feedback.
All reactions