GitHub App Setup Documentation
This guide will walk you through the steps to create and configure a GitHub App for your integration needs.
๐ Prerequisites
- A GitHub account with access to the organization or repositories where the app will be installed.
- Admin permissions for the organization if the app is organization-wide.
๐ ๏ธ Step 1: Create the GitHub App
- Go to GitHub Developer Settings (replace
{OrgName}with your actual organization name). - Click on "New GitHub App".
- Fill in the required fields:
- GitHub App name: Choose a unique and descriptive name. (e.g.,
EasyHosting App) - Homepage URL: (e.g.,
https://{SLUG}.easyhosting.strongminds.dev). - User authorization callback URL: Leave blank.
- Under Webhook, uncheck the Active checkbox.
- Under Permissions, add
- Repository permissions
- Actions = Read and write
- Administration = Read and write
- Contents = Read and write
- Environments = Read and write
- Workflows = Read and write
- Select Where can this GitHub App be installed?
-
Only on this account
-
Click Create GitHub App.
- Note down App Id (To be used in step 4)
๐ Step 2: Generate App Credentials
After creation:
- Generate a private key:
- Click Generate a private key.
- Download and securely store the
.pemfile. (To be used in step 4) - App ID and Client ID:
- Youโll find these on the app settings page.
- Client secret:
- Click Generate a new client secret.
- Store it securely.
๐ง Step 3: Install the App
- Go to your GitHub App settings.
- Click Install App.
- Choose to install on your user or organization account.
- Select the repositories to install it on, or grant access to all.
- Note down the installation id from the url
https://github.com/organizations/{ORG}/settings/installations/{INSTALLATION_ID}(To be used in step 4)
๐ป Step 4: Use the App in EasyHosting
- Navigate to your EasyHosting instance
- Goto Credentials
- Goto Code repository
- Add credential
- Add URL
https://github.com/{ORG} - Credential Type: Github App
- Insert the app id from the Github App
- Insert the installation id you noted down
- Insert the private key you generated in step 2
- Add repository credential
๐ Resources
๐งน Best Practices
- Keep your private key secure and rotate it periodically.
- Limit permissions to only what's necessary.