From 19dc46e5e045a737818024f8e6bd8cb1f9e42e94 Mon Sep 17 00:00:00 2001 From: Yukihiro Saito Date: Fri, 28 Jul 2023 00:14:30 +0900 Subject: [PATCH] feat: add openai-pr-reviewer (#4424) * feat: add openai-pr-reviewer Signed-off-by: Yukihito Saito * add OPENAI_API_ORG Signed-off-by: Yukihito Saito * change openai_heavy_model Signed-off-by: Yukihito Saito * remove OPENAI_API_ORG Signed-off-by: Yukihito Saito * Change action name Signed-off-by: Yukihito Saito --------- Signed-off-by: Yukihito Saito --- .github/workflows/openai-pr-reviewer.yaml | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/openai-pr-reviewer.yaml diff --git a/.github/workflows/openai-pr-reviewer.yaml b/.github/workflows/openai-pr-reviewer.yaml new file mode 100644 index 0000000000000..8445b0debb17e --- /dev/null +++ b/.github/workflows/openai-pr-reviewer.yaml @@ -0,0 +1,31 @@ +name: Code Review By ChatGPT + +permissions: + contents: read + pull-requests: write + +on: + pull_request: + pull_request_review_comment: + types: [created] + +concurrency: + group: ${{ github.repository }}-${{ github.event.number || github.head_ref || + github.sha }}-${{ github.workflow }}-${{ github.event_name == + 'pull_request_review_comment' && 'pr_comment' || 'pr' }} + cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }} + +jobs: + review: + runs-on: ubuntu-latest + steps: + - uses: fluxninja/openai-pr-reviewer@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + with: + debug: false + review_simple_changes: false + review_comment_lgtm: false + openai_light_model: gpt-3.5-turbo-0613 + openai_heavy_model: gpt-3.5-turbo-0613 # The default is to use GPT4, which needs to be changed to join ChatGPT Plus.