Skip to content

Robin is your AI pull request reviewer in the form of a super fast lightweight github action.

License

Notifications You must be signed in to change notification settings

Integral-Healthcare/robin-ai-reviewer

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robin AI

GitHub release (latest by date) GitHub org
Robin watercolor image

Named after Batman's assistant, Robin AI is an open source Github action that automatically reviews pull requests using GPT-4. It analyzes your code changes and provides:

  • A quality score (0-100)
  • Actionable improvement suggestions
  • Sample code snippets for better implementation
  • Fast, automated feedback (average runtime: 14s)

Table of Contents

Prerequisites

  • A GitHub repository with pull request workflows
  • An OpenAI API key (Get one here)

Installation

  1. In your Github repository, navigate to the "Actions" tab
  2. Click "New workflow"
  3. Choose "Set up a workflow yourself"
  4. Create a new file (e.g., robin.yml) with this configuration:
name: Robin AI Reviewer

on:
  pull_request:
    branches: [main]
    types:
      - opened
      - reopened
      - ready_for_review

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
      - name: Robin AI Reviewer
        uses: Integral-Healthcare/robin-ai-reviewer@v[INSERT_LATEST_RELEASE]
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPEN_AI_API_KEY: ${{ secrets.OPEN_AI_API_KEY }}
          files_to_ignore: |
            "README.md"
            "assets/*"
            "package-lock.json"
  1. Add your OpenAI API key:
    • Go to repository Settings → Secrets and Variables → Actions
    • Create a new secret named OPEN_AI_API_KEY
    • Paste your OpenAI API key as the value

Configuration

Name Required Default Description
GITHUB_TOKEN Yes Auto-supplied GitHub token for API access
OPEN_AI_API_KEY Yes N/A OpenAI API key
gpt_model_name No gpt-4-turbo GPT model to use
github_api_url No https://api.github.com GitHub API URL (for enterprise)
files_to_ignore No (empty) Files to exclude from review

Usage

When Robin AI runs, it will post a comment on the pull request with its score out of 100, suggested improvements, and sample code for improvement. You can use this information to improve the quality of your code and make your pull requests more likely to be accepted.

Example Output

When Robin AI reviews your pull request, you'll see a comment like this:

Score: 85/100

Improvements:

  • Consider adding input validation for the user parameters
  • The error handling could be more specific
  • Variable naming could be more descriptive
# Before
def process(x):
    return x * 2

# After
def process_user_input(value: int) -> int:
    if not isinstance(value, int):
        raise ValueError("Input must be an integer")
    return value * 2

Performance

  • Docker Image Size: 15.6MB
  • Average Runtime: 14 seconds
  • Memory Usage: Minimal (<100MB)

Demo

See Robin AI in action: View Demo

Contributing

We welcome contributions! Here's how you can help:

  • Submit bug reports or feature requests through Issues
  • Submit pull requests for bug fixes or new features
  • Improve documentation
  • Share feedback on Twitter

License

Robin AI is MIT licensed. See LICENSE for details.