When to use a GitHub App
- Your configuration repository is private.
- You need auditable, revokable permissions scoped to specific repositories.
- You want Pullbase to fetch short-lived installation tokens on behalf of agents.
Create the GitHub App
1
Register the app
- Visit https://github.com/settings/apps/new (or the equivalent GitHub Enterprise URL).
- Provide a descriptive App name (for example,
Pullbase Config App). - Set the Homepage URL to your Pullbase instance (
https://pullbase.example.com). - Set the Callback URL to
https://pullbase.example.com/api/v1/github-app/callback(reserved for future enhancements). - Leave the Webhook section disabled unless you plan to handle app-level webhooks separately.
2
Configure permissions
Grant only the permissions required:
- Repository permissions → Contents: Read-only
- Repository permissions → Metadata: Read-only
- All other permissions: No access
Pullbase only needs read access to fetch configuration files. Additional permissions are unnecessary and increase risk.
3
Install the app
Install the app on the organization/user that owns your configuration repository. Select the repositories Pullbase should access.
4
Capture credentials
After installation, record:Or via curl:
- App ID — Found on the app’s settings page under “About”
- App slug — Lowercase name in the app’s URL (e.g.,
pullbase-configfromgithub.com/apps/pullbase-config) - Installation ID — Found in the URL after installing:
github.com/settings/installations/{installation_id} - Repository ID — Query via GitHub API (see below)
- Private key — Download the
.pemfile from “Private keys” section
Configure Pullbase
Environment variables
GitHub Enterprise Server
For GitHub Enterprise Server (self-hosted), update the API base URL:github.com.
Environment-level configuration
When creating an environment (UI, CLI, or API) you provide GitHub App metadata:CLI validation
Use the bootstrap command to validate credentials locally before storing them on the server:--server-url, --admin-token, and environment details to persist the configuration as part of environment creation.
Agent flow
- The environment stores GitHub App metadata (installation ID, repository ID, app slug).
- An agent requests
GET /api/v1/agent/git-tokenusing its agent token. - Pullbase signs a JWT with the app’s private key and calls GitHub’s
/app/installations/{id}/access_tokensendpoint. - Pullbase returns the short-lived installation token to the agent, which uses it for
git clone. - Tokens expire in one hour; agents request fresh ones as needed.
Troubleshooting
403 when cloning
403 when cloning
- Verify the installation includes the repository. Check https://github.com/settings/installations for the app.
- Confirm the app has
Contents: Read-onlypermission.
Invalid private key
Invalid private key
- Regenerate the
.pemfile from the GitHub App settings and update the mounted secret. - Ensure the file has restricted permissions (readable only by the Pullbase container).
Rate limiting
Rate limiting
- GitHub Apps share a rate limit per installation. Reduce agent poll interval or enable webhooks to decrease token requests.
- Check
Retry-Afterheaders in error responses.
Webhook signature mismatch
Webhook signature mismatch
- Ensure the webhook secret in GitHub matches
PULLBASE_WEBHOOK_SECRET_KEY.