Overview
Bounty integrates with GitHub through both a GitHub App (for repository access and issue management) and GitHub OAuth (for user authentication).Features
- Sync GitHub repositories to your organization
- Create bounties directly from GitHub issues
- Automatic bot comments on issues when bounties are created or funded
- Track pull request submissions
- Multi-installation support for different organizations
GitHub App Setup
The GitHub App provides repository-level access for issue integration and bot functionality.Create a GitHub App
Navigate to GitHub Developer Settings and click New GitHub App.Configure the following settings:
- App name: Choose a unique name (e.g.,
bounty-your-org) - Homepage URL: Your Bounty instance URL
- Webhook URL:
https://your-domain.com/api/webhooks/github - Webhook secret: Generate with
openssl rand -base64 32
Configure Permissions
Set the following repository permissions:
- Issues: Read & Write (create comments, read issues)
- Pull requests: Read & Write (track submissions)
- Metadata: Read-only (access repository info)
Generate Private Key
After creating the app:
- Scroll to Private keys section
- Click Generate a private key
- Download the
.pemfile - Encode it to base64:
GitHub OAuth Setup
GitHub OAuth enables users to sign in and connect their GitHub accounts.Create OAuth App
Go to GitHub OAuth Apps and click New OAuth App.Configure:
- Application name: Your app name
- Homepage URL:
https://your-domain.com - Authorization callback URL:
https://your-domain.com/api/auth/callback/github
Installing the GitHub App
Once configured, users can install the GitHub App to their repositories:Select Repositories
Choose which repositories to grant access to:
- All repositories (current and future)
- Specific repositories only
Repository Management
Viewing Installations
API endpoint:githubInstallation.getInstallations
Returns all GitHub App installations for your organization:
Fetching Repositories
API endpoint:githubInstallation.getRepositories
Get all repositories for a specific installation:
Setting Default Installation
For organizations with multiple installations, set a default:Issue Integration
When you create a bounty linked to a GitHub issue, Bounty automatically:- Posts a bot comment on the issue with bounty details
- Updates the comment when the bounty is funded
- Tracks PR submissions when contributors open pull requests
- Updates submission comments when payment status changes
Bot Comment Example
When a bounty is created:Webhook Handling
Bounty listens for GitHub webhook events to sync installations and issues.Supported Events
installation.created- New app installationinstallation.deleted- App uninstalledinstallation_repositories.added- Repos added to installationinstallation_repositories.removed- Repos removedissues.opened- New issue createdpull_request.opened- New PR submission
Webhook Security
Webhooks are verified using theGITHUB_WEBHOOK_SECRET:
Removing an Installation
To disconnect a GitHub installation:- Revoke the app’s access on GitHub
- Delete the installation record from the database
- Remove associated bounty links (bounties remain, but lose GitHub integration)
Only organization owners can remove installations.
Troubleshooting
Installation Not Showing
- Verify the GitHub App is installed on the correct organization
- Check that
GITHUB_APP_IDmatches your GitHub App - Ensure the user has connected their GitHub OAuth account
Bot Comments Not Appearing
- Confirm the app has Issues: Read & Write permission
- Check webhook delivery in GitHub App settings
- Verify
GITHUB_WEBHOOK_SECRETmatches GitHub configuration
Private Key Errors
GITHUB_APP_PRIVATE_KEY.
API Reference
getInstallations
Get all installations for the active organization.
Returns: Array of installations with metadata
getRepositories
Input: { installationId: number }
Returns: Array of repositories with name, URL, and description
syncInstallation
Input: { installationId: number }
Manually sync an installation after adding new repositories.
removeInstallation
Input: { installationId: number }
Uninstalls the GitHub App and removes the installation record.
Requires: Organization owner role
setDefaultInstallation
Input: { installationId: number }
Sets the default installation for creating new bounties.
Requires: Organization owner role