| title | description |
|---|---|
GitHub App Integration |
Connect Pullbase to private Git repositories using a GitHub App. |
Pullbase supports GitHub Apps to securely access private repositories without embedding personal access tokens.
- 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.
- Repository permissions → Contents: Read-only
- Repository permissions → Metadata: Read-only
- All other permissions: No access
- 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
Finding the Repository ID:
# Using GitHub CLI
gh api /repos/{owner}/{repo} --jq '.id'
# Example
gh api /repos/acme/infra-config --jq '.id'
# Output: 964854370Or via curl:
curl -s https://api.github.com/repos/{owner}/{repo} | jq '.id'PULLBASE_GIT_ENABLED=true
PULLBASE_GITHUB_APP_ID=2113565
PULLBASE_GITHUB_APP_PRIVATE_KEY_PATH=/config/github-app.pem
PULLBASE_GITHUB_APP_API_BASE_URL=https://api.github.comMount the private key into the container at the configured path:
volumes:
- ./config/github-app.pem:/config/github-app.pem:roUsing Docker secrets (recommended for production):
services:
central-server:
image: pullbaseio/pullbase:latest
environment:
- PULLBASE_GITHUB_APP_PRIVATE_KEY_PATH=/run/secrets/github_app_key
secrets:
- github_app_key
secrets:
github_app_key:
file: ./config/github-app.pemFor GitHub Enterprise Server (self-hosted), update the API base URL:
PULLBASE_GITHUB_APP_API_BASE_URL=https://github.mycompany.com/api/v3The app registration and installation process is the same, but use your GitHub Enterprise URL instead of github.com.
When creating an environment (UI, CLI, or API) you provide GitHub App metadata:
{
"name": "staging",
"repo_url": "https://github.com/your-org/configs.git",
"branch": "main",
"deploy_path": "environments/staging/config.yaml",
"installation_id": 89968159,
"repository_id": 964854370,
"app_slug": "pullbase-config"
}Use the bootstrap command to validate credentials locally before storing them on the server:
pullbasectl github-app bootstrap \
--app-id 2113565 \
--private-key /config/github-app.pem \
--installation-id 89968159 \
--repository-id 964854370 \
--app-slug pullbase-configAdd --server-url, --admin-token, and environment details to persist the configuration as part of environment creation.
- 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.
gh api /app/installations --jq '.[].id'