Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
git-pull-request

GitHub Action

AI Assisted Code Review

0.2

AI Assisted Code Review

git-pull-request

AI Assisted Code Review

Use LLMs to perform automatic code reviews. Powered by AutoReviewer

Installation

Copy and paste the following snippet into your .yml file.

              

- name: AI Assisted Code Review

uses: gvasilei/AutoReviewer@0.2

Learn more about this action in gvasilei/AutoReviewer

Choose a version

typescript-action status

πŸ€– Automated Code Reviews powered by ChatGPT πŸ€–

A GitHub action uses OpenAI's GPT-4 to perform automated code reviews. When you create a PR, our action will automatically review the code and suggest changes, just like a human code reviewer would.

πŸš€ How to use it

  • Get an API Key from OpenAI
  • Add it as a Github secret
  • Setup an action that runs on every PR
name: 'code-review'
on: # rebuild any PRs and main branch changes
  pull_request:
jobs:
  code-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ./
        env:
          NODE_OPTIONS: '--experimental-fetch'
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          openai_api_key: ${{ secrets.OPENAI_API_KEY }}
          exclude_files: '*.js, *.json, *.md, *.yml, *.js.map'
  • Or when a label is added
name: 'code-review'
on: # rebuild any PRs and main branch changes
  pull_request:
    types: [labeled]
jobs:
  code-review:
    if: ${{ contains( github.event.label.name, 'AutoReview') }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ./
        env:
          NODE_OPTIONS: '--experimental-fetch'
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          openai_api_key: ${{ secrets.OPENAI_API_KEY }}
          exclude_files: '*.js, *.json, *.md, *.yml, *.js.map'

πŸŽ‰ Benefits

Using our GitHub action has many benefits, such as:

  • Faster code reviews
  • More consistent feedback
  • Increased productivity
  • Improved code quality

🀞 Limitations

  • This Github Action is still in early development.
  • While the action supports both gpt-4 and gpt-3.5-turbo, gpt-4 gives much better suggestions.

πŸ™Œ Contributing

If you have any ideas or improvements to our GitHub action, feel free to submit a PR. We welcome all contributions!