Skip to content
code

GitHub Action

rebotai

v1.2.0 Latest version

rebotai

code

rebotai

A GitHub bot powered by OpenAI for code review on pull requests

Installation

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

              

- name: rebotai

uses: fiqryq/rebotai@v1.2.0

Learn more about this action in fiqryq/rebotai

Choose a version

Rebotai

Rebotai is a GitHub bot powered by OpenAI that performs code reviews on pull requests.

Usage

To integrate Rebotai into your GitHub repository, follow these steps:

  1. Add Repository Secrets: Go to your repository settings and add the following secrets:

    • GH_TOKEN: Your GitHub token
    • OPENAI_API_KEY: Your OpenAI API key
  2. Add Repository Variables: Add the following variables:

    • MODEL: The OpenAI model to use (e.g., gpt-3.5-turbo)
    • LANGUAGE: The preferred language for responses (e.g., indonesia)
  3. Add GitHub Actions Workflow: Create a new GitHub Actions workflow file (e.g., .github/workflows/rebotai.yml) with the following content:

    name: Rebotai Code Review
    on:
      issue_comment:
        types: [created]
    
    jobs: 
      code_review:
        if: >
          github.event.issue.pull_request != null &&
          contains(github.event.comment.body, '/review')
        runs-on: ubuntu-latest
        steps:
          - uses: fiqryq/rebotai@{version}
            with:
              gh-token: ${{ secrets.GH_TOKEN }}
              openai-api-key: ${{ secrets.OPENAI_API_KEY }}
              model: ${{ vars.MODEL }}
              language: ${{ vars.LANGUAGE }}

Example Responses

Here are examples of responses in different languages based on the configured LANGUAGE variable:

Japanese

language: ${{ vars.LANGUAGE }} # japan

Japanese Response

Indonesian

language: ${{ vars.LANGUAGE }} # indonesia

Indonesian Response

English

language: ${{ vars.LANGUAGE }} # english

English Response

Contributing

We welcome contributions! Please feel free to submit issues or pull requests to improve Rebotai.

License

This project is licensed under the MIT License.