Skip to content

【工具推荐】基于 ChatGPT 的 Github Code Review 机器人 #2912

Open
@anc95

Description

@anc95

Github 地址:ChatGPT-CodeReview
机器人地址:github.com/apps/cr-gpt

使用

机器人

需要有自己的 openai 账号,并生成 API_KEY

  1. 安装机器人,并按 ChatGPT-CodeReview 文档配置 API_KEY
  2. 新建一个 pull request 或给已有的 pr push 新的代码都会触发机器人 review,review 的结果会评论在每一个文件最下方

demo:

image

通过 Github Actions 方式集成

Github Actions

配置 .github/workflow/cr.yml

name: Code Review

permissions:
  contents: read
  pull-requests: write

on:
  pull_request:
    types: [opened, reopened]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: anc95/ChatGPT-CodeReview@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions