GitHub PR Review Bot
GitHub PR Review Bot — easy-to-understand guide based on official docs
Imagine having a tireless teammate who reviews every pull request the moment it lands—no coffee breaks, no “I’ll get to it later.” That’s exactly what you can build with Hermes Agent.
What We’re Building
A bot that watches your GitHub repositories and automatically reviews new pull requests. When someone opens a PR, the bot jumps in, checks the diff, and posts feedback—all through WeChat, so you see reviews right in your chat app.
Step 1: Get Your WeChat Gateway Ready
First, we need to connect Hermes to WeChat. This uses iLink Bot, which lets you receive and send messages without running a server.
# Install Hermes Agent
pip install hermes-agent
# Set up the WeChat adapter
hermes gateway setup
You’ll see a QR code—scan it with your WeChat to log in. The credentials are saved automatically.
Step 2: Configure Your Bot
Create a config.yaml file and add your WeChat settings:
platforms:
weixin:
extra:
account_id: your-account-id
dm_policy: open
Now add the GitHub integration. You’ll need a personal access token from GitHub:
integrations:
github:
token: your-github-token
repos:
- your-username/your-repo
Step 3: Write the Review Logic
Create a simple script that triggers on new PRs:
from hermes import Agent
agent = Agent()
@agent.on("github.pull_request.opened")
async def review_pr(event):
pr = event.pull_request
diff = await pr.get_diff()
# Simple check: flag large PRs
if len(diff.splitlines()) > 500:
await pr.comment("⚠️ This PR is quite large. Consider splitting it.")
# Check for missing tests
if "test" not in diff.lower():
await pr.comment("Heads up: no test changes detected.")
Step 4: Start the Gateway
hermes gateway
That’s it! Your bot is now live. When someone opens a PR, it automatically posts comments to the PR and sends you a WeChat notification.
Why This Rocks
- No webhooks or servers—Hermes long-polls GitHub, so no public endpoint needed
- Smart message handling—long reviews stay in one bubble, not split awkwardly
- Typing indicators—you see “typing…” in WeChat while the bot works
- Retry built-in—transient errors don’t crash your bot
Summary & Pro Tip
You just built a PR review bot that works through WeChat, with zero infrastructure. Start simple—flag large PRs, check for missing tests, or remind about changelog updates.
Practical tip: Begin with just one check (like the test detection above). Run it for a week, see what your team actually needs, then add more rules. A bot that does three things well beats one that tries everything and annoys everyone.
📖 Official Docs
This article is based on the official Hermes Agent documentation:Official docs › guides/github-pr-review