GitHub App Setup
Create the App
- Go to GitHub Settings > Developer Settings > GitHub Apps > New GitHub App
- Fill in:
- App name:
ClearPR(or your preferred name) - Homepage URL: Your server URL
- Webhook URL:
https://your-server.com/webhook - Webhook secret: Generate a strong secret and save it for
.env
- App name:
Set Permissions
| Permission | Access | Why |
|---|---|---|
| Pull requests | Read & Write | Read PR metadata/diff, post review comments |
| Contents | Read | Fetch file contents for AST parsing |
| Metadata | Read | Required for all GitHub Apps |
| Issues | Read | Read comments for @clearpr commands |
Subscribe to Events
Check these event subscriptions:
pull_requestpull_request_review_commentissue_commentinstallationinstallation_repositories
Generate Private Key
- Scroll to the bottom of the app settings
- Click Generate a private key
- Save the downloaded
.pemfile - Set
GITHUB_PRIVATE_KEYin.envto the file path or the key content
Install the App
- Go to Install App in the sidebar
- Select the organizations/repos you want ClearPR to review
- Approve the permissions
Verify
After starting ClearPR, open a PR in any installed repo. You should see:
- A webhook delivery in the app's Advanced tab
- ClearPR posting a review comment on the PR
TIP
Check ClearPR logs if reviews aren't appearing:
bash
docker compose logs app --tail 50