Overview
This guide explains how to create and configure a GitHub App for Orphelix.Setting up a GitHub App takes about 5-10 minutes and provides the most secure integration method.
Step 1: Create GitHub App
For Personal Account
Navigate to GitHub Settings
For Organization
Go to Organization Settings
Navigate to your organization → Settings → Developer settings → GitHub Apps
Step 2: Configure Basic Settings
Fill in the following fields in the GitHub App creation form:| Field | Value | Description |
|---|---|---|
| GitHub App name | Orphelix (or any unique name) | Display name for the app |
| Homepage URL | http://localhost:3000 | Your Orphelix URL |
| Callback URL | http://localhost:3000/api/github-app/callback | OAuth callback endpoint |
| Setup URL | Leave empty | Not needed |
| Webhook | ❌ Disable “Active” | We don’t use webhooks |
Step 3: Set Permissions
Under Repository permissions, configure the following:- Contents
- Pull requests
- Metadata
Access level:
Read and writeRequired for:- Reading YAML files from repository
- Creating/updating files for PRs
Summary of Permissions
Step 4: Create the App
Step 5: Install the App
Select repositories
Choose repository access:
- All repositories - Grant access to all current and future repos
- Only select repositories - Choose specific repos (recommended)
Step 6: Get Credentials
You need three credentials to configure Orphelix:1. App ID
2. Client ID & Client Secret
3. Private Key
Step 7: Configure Environment Variables
Create or update.env.local in your Orphelix project root:
Converting Private Key
- macOS/Linux
- Windows
Make sure to keep the quotes around the private key value and preserve all line breaks
Generating NEXTAUTH_SECRET
Step 8: Verify Installation
Troubleshooting
App not showing in Settings
App not showing in Settings
Possible causes:
- Environment variables not set correctly
.env.localnot loaded (restart dev server)- NEXTAUTH_SECRET not generated
Authorization fails
Authorization fails
Cannot read repositories
Cannot read repositories
Possible causes:
- App not installed on repository
- Missing Contents permission
- Go to GitHub Settings → Applications → Installed GitHub Apps
- Click Configure on your app
- Verify repository access
Private key errors
Private key errors
Possible causes:
- Private key format incorrect
- Missing BEGIN/END lines
- Extra quotes or escaping
- Ensure private key includes
-----BEGIN RSA PRIVATE KEY-----and-----END RSA PRIVATE KEY----- - Use double quotes around the entire key
- Preserve line breaks
Production Deployment
For production, update these values:Security Best Practices
Private Key Storage
Private Key Storage
- Never commit
.env.localto git - Store private key in secure secret manager (production)
- Rotate keys periodically
Repository Access
Repository Access
- Only grant access to necessary repositories
- Use “Only select repositories” instead of “All repositories”
- Review access permissions regularly
Token Management
Token Management
- Tokens are stored in HTTP-only cookies
- Automatic refresh every 8 hours
- Revoke access from GitHub when not needed
Next Steps
Use YAML Editor
Learn how to edit Kubernetes manifests
Create Pull Requests
Create and manage PRs