Skip to content
gift

GitHub Action

Azure OpenAI CodeReviewer

0.0.3 Latest version

Azure OpenAI CodeReviewer

gift

Azure OpenAI CodeReviewer

A Code Review Action Powered By ChatGPT

Installation

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

              

- name: Azure OpenAI CodeReviewer

uses: stanlee000/[email protected]

Learn more about this action in stanlee000/ChatGPT-CodeReview

Choose a version

CodeReview BOT

Using Github Actions

actions/chatgpt-codereviewer

  1. add the AZURE_OPENAI_API_KEY to your github actions secrets
  2. create .github/workflows/cr.yml add bellow content
code-review:
  runs-on: ubuntu-latest
  permissions:
    pull-requests: write
    contents: read
  steps:
    - name: Azure OpenAI CodeReviewer
      uses: stanlee000/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
        AZURE_API_ENDPOINT: https://openai-northus-region.openai.azure.com/
        AZURE_OPENAI_DEPLOYMENT_NAME: gpt4-turbo
        AZURE_OPENAI_API_VERSION: 2023-09-15-preview
        # Optional
        AZURE_OPENAI_API_ASSISTANT_INSTRUCTION: # example: Please check if there are any confusions or irregularities in the following code diff:
        top_p: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-top_p
        temperature: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature
        max_tokens: 10000
        MAX_PATCH_LENGTH: 10000 # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length.

Credit

this project is inpired by codereview.gpt

License

ISC © 2023 anc95