Public
Like
2
pr-reviewer
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v4View latest version
A GitHub code review bot that automatically analyzes pull requests using Claude AI and posts review comments.
- Responds to GitHub pull request webhooks
- Analyzes code changes using Anthropic's Claude
- Posts detailed review comments on PRs
- Secure webhook signature verification
-
GitHub Token: Create a fine-grained personal access token with:
- Repository access to your target repo
- Metadata: Read-only
- Contents: Read-only
- Pull requests: Read and write
-
Anthropic API Key: Get your API key from Anthropic Console
-
Environment Variables: Set these in Val Town:
GITHUB_TOKEN: Your GitHub personal access tokenANTHROPIC_API_KEY: Your Anthropic API keyWEBHOOK_SECRET: A random secret string for webhook verification
-
GitHub Webhook: Configure in your repository settings:
- Payload URL: Your Val Town HTTP endpoint
- Content type: application/json
- Secret: Same as WEBHOOK_SECRET
- Events: Pull requests
The bot automatically reviews pull requests when they are opened or reopened. It will:
- Fetch the changed files from the PR
- Analyze the code using Claude
- Post a review comment with findings
index.ts- Main webhook handler and review logicgithub.ts- GitHub API integrationclaude.ts- Claude AI integrationutils.ts- Utility functions for webhook verification