Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/rest/repos/forks#create-a-fork
What part(s) of the article would you like to see updated?
POST /repos/{owner}/{repo}/forks is currently documented as
This endpoint works with the following fine-grained token types:
GitHub App user access tokens
GitHub App installation access tokens
Fine-grained personal access tokens
There is no hint or indication that none of these work when forking between private repositories of different organizations.
Furthermore the feedback received when attempting this operation using GHA tokens are of an extreme level of unhelpfulness: given a GHA installed in both organizations A and B as well as a user account which has admin access to both, trying to fork a private repository A.r into B
- Using the installation access token (IAT) for A, the fork returns a success, but the
organization field is ignored and it creates the fork into A.
- Using the IAT for B, the fork fails with a 404 (this makes some sense, although the feedback is unhelpful).
- Using the user access token for the user, the fork returns a 403 with the error message "resource not accessible by integration".
Additional information
Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/rest/repos/forks#create-a-fork
What part(s) of the article would you like to see updated?
POST /repos/{owner}/{repo}/forksis currently documented asThere is no hint or indication that none of these work when forking between private repositories of different organizations.
Furthermore the feedback received when attempting this operation using GHA tokens are of an extreme level of unhelpfulness: given a GHA installed in both organizations A and B as well as a user account which has admin access to both, trying to fork a private repository A.r into B
organizationfield is ignored and it creates the fork intoA.Additional information