Create repository on a user account using GH App #171040
Select Topic AreaQuestion BodyI created a new GitHub App that requires administration read-write permissions. I installed the app on my personal account, and I'm trying to use it to create a new repository. The app creates an "installation ID" that lacks the necessary permissions to create a new repository for my user account. Am I correct here? Is there a way to create a repository for a user using the GitHub app? Thanks in advance, |
Replies: 1 comment 1 reply
|
You are basically right. A GitHub App installation has access only to the resources it was granted on installation. And those resources differ depending on whether the installation is on an organization or a user account. If you need to create repos in an organization: If you want to create repos in a personal account: Workarounds
If you can move to an organization account, then you can let the App handle repo creation entirely. So basically: |
You are basically right. A GitHub App installation has access only to the resources it was granted on installation. And those resources differ depending on whether the installation is on an organization or a user account.
If you need to create repos in an organization:
Install the app on the org with administration:write, then use the Create a repository in an organization API with the installation token.
If you want to create repos in a personal account:
That’s not supported with GitHub App tokens. To do this, you’d need to fall back to an OAuth App or a personal access token (PAT) tied to the user account.
Workarounds
If the repo must live in your personal account, you’ll need to: