| name | github-code-review |
| description | Automated code review for GitHub pull requests. Analyze diffs, leave inline comments, flag issues, and enforce code quality standards. |
| version | 1.0.0 |
| author | joyboy257 |
| license | MIT |
| prerequisites | {"env_vars":["GITHUB_TOKEN"]} |
| metadata | {"hermes":{"tags":["github","code-review","pr","git","quality"]}} |
github-code-review
Automated PR reviews without the mental overhead.
Setup
gh auth login
export GITHUB_TOKEN="ghp_your_token_here"
Usage
gh pr list --repo owner/repo --state open
gh pr diff owner/repo 123
gh api repos/owner/repo/issues/123/comments -f body="LGTM but consider adding tests"
gh pr status
Automated Review Script
#!/bin/bash
REPO=$1
PR_NUM=$2
echo "Reviewing PR #$PR_NUM on $REPO..."
gh pr diff "$REPO" "$PR_NUM" > /tmp/pr.diff
if grep -q "console.log" /tmp/pr.diff; then
echo "Found console.log statements"
fi
if grep -q "TODO" /tmp/pr.diff; then
echo "Found TODO comments"
fi
if [ $(wc -l < /tmp/pr.diff) -gt 500 ]; then
echo "PR is large (>$((500)) lines)"
fi
gh pr review "$PR_NUM" --repo "$REPO" --comment --body "Automated review complete. See comments inline."
GitHub Actions Integration
Add to .github/workflows/review.yml:
name: Code Review
on: [pull_request]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run review
run: |
gh pr diff ${{ github.event.pull_request.number }} > diff.txt
# Your review logic here
Review Checklist