GitHub App can't fork repositories #24607
-
Hi 👋, According to the REST API docs (link), GitHub Apps should be able to fork a repository. Unfortunately, that isn’t the case. I experience two different errors, depending on whether I grant the GitHub App access to all repositories or to a selected repository only. With access to all repositories
With access to a selected repository
Below is the code I use:
Does anybody know why this fails? Thanks, Mike |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
I’d file a ticket to https://support.github.com/ |
Beta Was this translation helpful? Give feedback.
-
Thanks @jsoref for the tip. I received a response that explains why it doesn’t work in my situation. For anyone else ending up here:
|
Beta Was this translation helpful? Give feedback.
-
Makes sense. For people wondering “what to do?”, you can set up an account, make it a member of the destination org (and if necessary the origin org), and then create a personal access token for it: And then use that secret instead of the app secret to fork. |
Beta Was this translation helpful? Give feedback.
-
That’s the approach I ended up with – works like a charm. I went for 3 different personal access tokens: dev, preview, prod. |
Beta Was this translation helpful? Give feedback.
-
So when the "Create a Fork" documentation says "Works with GitHub Apps", is that a mistake/error and apps cannot create a fork in any way? |
Beta Was this translation helpful? Give feedback.
Thanks @jsoref for the tip. I received a response that explains why it doesn’t work in my situation.
For anyone else ending up here: