Skip to main content

Installation

Environment Variables

Create a GitHub App or use a Personal Access Token. GitHub Apps are recommended for team/organization bots.

Configuration Options

Setup

For personal projects or testing:
PAT mode uses your personal account. GitHub Apps are recommended for organization bots.

Webhook Handler

Configure webhook in your GitHub repository or app settings:
  • Payload URL: https://your-app.com/webhooks/github
  • Content type: application/json
  • Secret: Your webhook secret
  • Events: Issue comments, Pull request review comments

Features

Supported Events

  • issue_comment (created) - Comments on PR Conversation tab
  • pull_request_review_comment (created) - Line-specific comments on Files Changed tab

Thread Types

GitHub adapter supports two thread types: 1. PR-level threads (Conversation tab)
All comments on the PR’s main conversation. 2. Review comment threads (Files Changed tab)
Line-specific discussion threads on code changes.

Posting Comments

Post to PR conversation:
Reply to a review comment thread:

Markdown Support

GitHub supports full GitHub Flavored Markdown:
`);

Cards

Cards are converted to GitHub Flavored Markdown tables:
GitHub doesn’t support interactive components. Buttons are rendered as markdown links.

Thread IDs

GitHub thread IDs encode repository and PR information:
Examples:
  • PR conversation: github:vercel/next.js:12345
  • Review thread: github:vercel/next.js:12345:rc:98765

Message History

Fetch comments from a thread:

Listing Threads

List all open PRs (threads) in a repository:

Platform Limits

  • Comment length: 65,536 characters
  • File size: 25 MB per file in PR
  • Rate limits: 5,000 requests/hour (authenticated), 60 requests/hour (unauthenticated)
See GitHub rate limits for details.

Code Examples

Troubleshooting

  • Verify GITHUB_WEBHOOK_SECRET matches the secret in GitHub settings
  • Ensure webhook Content-Type is application/json
  • Check that request body is raw (not parsed)
  • Enable “Issue comments” and “Pull request review comments” events
  • Verify webhook URL is publicly accessible (HTTPS required)
  • Check that app/PAT has repo scope
  • Use a persistent StateAdapter (Redis, not Memory)
  • Ensure webhooks include installation field
  • Check that installation IDs are being cached (debug logs)
  • Use the correct thread ID format: github:owner/repo:123:rc:456
  • Review comment ID is the ROOT comment, not the reply
  • Ensure bot has write access to the repository

Required Permissions

GitHub App Permissions:
  • Pull requests: Read & write (post comments, read PRs)
  • Issues: Read & write (for PR conversations)
  • Metadata: Read (repository metadata)
Personal Access Token Scopes:
  • repo - Full repository access

Creating a GitHub App

1

Create app

Go to GitHub Developer Settings and create a new GitHub App.
2

Configure permissions

  • Pull requests: Read & write
  • Issues: Read & write
  • Metadata: Read
3

Subscribe to events

  • Issue comments
  • Pull request review comments
4

Generate private key

Generate and download the private key PEM file.
5

Install app

Install the app on your account or organization to get the installation ID.

Next Steps

Message Handling

Process comments and build review flows

GitHub Apps

Learn about GitHub Apps

Code Review Bots

Build automated code review assistants

State Management

Persist data across PR comments