⚒️ Review GitHub pull requests with AI and log results to PostgreSQL and Slack

34 views · ⚒️ Engineering

💡 Pro Tip — If you need GitHub data beyond what the REST API gives you, ScraperNode has a repository scraper that extracts metadata at scale without token rate limits.

View All Scrapers

Description

Automatically detects new GitHub Pull Requests, analyzes changed code with AI, generates detailed review comments (quality, security, performance, best practices), posts suggestions back to the PR, stores results in a database, and sends notifications.

Good to Know

How It Works

1. Trigger PR Detection

2. Fetch & Analyze Code

3. AI Review & Score

4. Post Review & Notify

Data Sources

How to Use

  1. Import the workflow JSON into your n8n instance
  2. Configure credentials:
    • GitHub OAuth / Personal Access Token (with repo scope)
    • AI provider API key (Grok/OpenAI/etc.)
    • PostgreSQL database connection
    • Slack/Discord/Email credentials
  3. Set up GitHub Webhook:
    • In repo Settings → Webhooks → Add webhook
    • Payload URL = your n8n webhook URL
    • Content type: application/json
    • Events: Pull requests
  4. Customize AI prompt — add repo-specific rules, coding standards, ignored patterns
  5. Tune filters — minimum severity to post, files to skip (e.g. lock files, generated code)
  6. Test — create/open a small PR or use Execute Workflow with sample payload
  7. Activate — turn on the workflow and monitor Executions + Logs

Requirements

Customizing This Workflow

🔗 Nodes Used

Github Trigger, HTTP Request, Postgres

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup