Skip to content

A GitHub Action that uses the OpenAI API to leave code review comments when Pull Requests are enabled.

License

Notifications You must be signed in to change notification settings

cawcaw253/ai-review-action

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

Repository files navigation

OpenAI PR Code Review Action

OpenAI generate code review when Pull Request opened.

review_example

How to use

When you use Personal Access Token, please check permission.


name: OpenAI PR Review
uses: cawcaw253/ai-review-action@latest
with:
  GITHUB_TOKEN: ${{ secrets.GH_PAT }}
  OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  LANGUAGE: "english"

If you use GITHUB_TOKEN, please check jobs permission when leave comment action failed.


name: OpenAI Code Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    permissions: write-all # Check permission when leave comment action failed
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: OpenAI PR Review
        uses: cawcaw253/ai-review-action@latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          LANGUAGE: "korean"
          MODEL: "gpt-3.5-turbo"

Inputs

Inputs Description Required Default
OPENAI_API_KEY OpenAI Key for API call true
GITHUB_TOKEN Token for checkout code and leave comment true
LANGUAGE Language for comments false English
MODEL Model for chat completion false gpt-3.5-turbo

Outputs

Does not provide any outputs.

About

A GitHub Action that uses the OpenAI API to leave code review comments when Pull Requests are enabled.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published