GitHub
Add a bot to GitHub using the official integration.
The official GitHub integration allows your bot to interact with your GitHub repositories.
Setup
You will need:
When using this configuration mode, a Botpress-managed GitHub App connects to your GitHub organizations and repositories. The app has the necessary permissions to listen to pull request and issue events and to create comments on issues, pull requests, and discussions.
If you need more granular control over permissions or prefer to use your own GitHub App, choose one of the manual configuration options instead.
For advanced use cases, you can use your own GitHub App with our integration.
You will need:
Step 1: Install the integration
First, install the integration in Botpress:
Step 2: Create a GitHub App
Next, create your GitHub App:
Step 3: Configure permissions
Set the required permissions for your GitHub App:
Repository permissions:
- Discussions: Read & write
- Issues: Read & write
- Pull requests: Read & write
Organization permissions:
- Team discussions: Read & write
Step 4: Subscribe to webhook events
Select the webhook events your bot should receive:
- Discussion
- Discussion comment
- Issues
- Issue comment
- Pull request
- Pull request review
- Pull request review comment
- Pull request review thread
When you’re done, select Create GitHub App.
Step 5: Generate a private key
Next, generate a private key:
Step 6: Install the GitHub App
Now you can install the GitHub App:
Step 7: Configure the integration in Botpress
Finally, fill in the integration’s configuration fields:
GitHub App ID
GitHub App ID
- In your GitHub App’s General tab, find the App ID field.
- Copy the App ID and paste it into the GitHub App ID field in Botpress.
GitHub App Private Key
GitHub App Private Key
Open the .pem file you downloaded earlier and paste its entire contents into the GitHub App Private Key field.
GitHub Webhook Secret
GitHub Webhook Secret
Paste the webhook secret key you generated in Step 2 into the GitHub Webhook Secret field.
GitHub App Installation ID
GitHub App Installation ID
- Navigate to your organization’s Settings > Installed GitHub Apps.
- Find your newly installed GitHub App and select Configure.
- Look at the URL—it should end with
/installations/:installation_id. For example, inhttps://github.com/organizations/my-org/settings/installations/123456, the installation ID is123456. - Copy the installation ID and paste it into the GitHub App Installation ID field in Botpress.
When you’ve filled in all the fields, select Save Configuration. This will automatically enable your integration.
You’ve manually configured your GitHub integration with a GitHub App!
You can also use a Personal Access Token (PAT) to connect your GitHub account to Botpress.
When you use a PAT, actions taken by the bot will be attributed to your personal GitHub account. If you want actions attributed to your organization, use the GitHub App configuration instead.
GitHub Apps also don’t consume a seat in your organization and offer more granular permissions—we recommend using them for production use cases.
You will need:
Step 1: Install the integration
Step 2: Enable fine-grained PATs for your organization
If you’re using an organization, you need to enable fine-grained Personal Access Tokens:
You don’t need to enable classic personal access tokens.
Step 3: Set up the webhook
Configure the webhook:
- Payload URL: Paste the webhook URL from Botpress.
- Content type: Select
application/json. - Secret: Generate a secure secret key and paste it here.
Step 4: Create a fine-grained Personal Access Token
Configure the token:
- Token name: Enter a descriptive name (e.g., “Botpress Integration”).
- Expiration: Choose an appropriate expiration date.
- Resource owner: Select your organization (or personal account).
- Repository access: Select the repositories your bot needs access to.
If you select Public Repositories only, the bot won’t be able to reply to issues or pull requests.
Step 5: Configure the integration in Botpress
Fill in the integration’s configuration fields:
GitHub Personal Access Token
GitHub Personal Access Token
Paste the Personal Access Token you generated in the previous step.
GitHub Webhook Secret
GitHub Webhook Secret
Paste the webhook secret key you generated in Step 3.
When you’ve filled in all the fields, select Save Configuration. This will automatically enable your integration.
You’ve manually configured your GitHub integration with a Personal Access Token!
Cards
List items in folder
List the files and folders in a folder
inputobjectoutputobjectTransfer file to Botpress
Transfer a file from an external service to Botpress
inputobjectoutputobjectFind Target
Find a target in a repository
inputobjectoutputobjectTriggers
aggregateFileChanges
payloadobjectfileCreated
payloadobjectfileDeleted
payloadobjectfileUpdated
payloadobjectfolderDeletedRecursive
payloadobjectIssue opened
Triggered when an issue is opened
payloadobjectPull Request merged
Triggered when a pull request is merged
payloadobjectPull Request opened
Triggered when a pull request is opened
payloadobjectPull Request review submitted
Triggered when a review is submitted on a pull request
payloadobject