Skip to content

ChatGPT PR Code Review

Actions
Get an explanation of code changes in a pull request and comment on it
1.0.1
Latest
Star (14)

chatgpt-pr-comment

This action takes as input a GIT_TOKEN and an OPENAI_TOKEN, sends the git diff to ChatGPT and comments on the PR with an explanation on what was changed on the PR.

Optionally, you can specify a chatgpt model from this list: gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301.

Keep in mind, that you need access in order to use gpt-4, and right now API access is currently in limited beta.

By default gpt-3.5-turbo, will be used.

Usage Example

Without specifying the model

name: ChatGPT PR Code Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - name: Review code
        uses: flavius-dinu/[email protected]
        with:
          github-token: ${{ secrets.GIT_TOKEN }}
          openai-token: ${{ secrets.OPENAI_TOKEN }}

Specifying the model:

name: ChatGPT PR Code Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - name: Review code
        uses: flavius-dinu/[email protected]
        with:
          github-token: ${{ secrets.GIT_TOKEN }}
          openai-token: ${{ secrets.OPENAI_TOKEN }}
          chatgptmodel: "gpt-3.5-turbo-0301"

ChatGPT PR Code Review is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Get an explanation of code changes in a pull request and comment on it
1.0.1
Latest

ChatGPT PR Code Review is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.