Install/run via GitHub Actions

Seamlessly integrate automated code reviews into your GitHub Actions workflows.

Prerequisites

  • Bito Access Key: Obtain your Bito Access Key. View Guide

  • GitHub Personal Access Token (Classic): For GitHub PR code reviews, ensure you have a CLASSIC personal access token with repo access. We do not support fine-grained tokens currently. View Guide


Installation and Configuration Steps:

  1. Enable GitHub Actions:

    • Login to your GitHub account.

    • Open your repository and click on the "Settings" tab.

    • Select "Actions" from the left sidebar, then click on "General".

    • Under "Actions permissions", choose "Allow all actions and reusable workflows" and click "Save".

  2. Set Up Environment Variables:

    • Still in the "Settings" tab, navigate to "Secrets and variables" > "Actions" from the left sidebar.

    • Click "New repository secret".

    • Add the following secrets with their exact names and values. For each secret, click "Add secret" after entering its value.

      • Name: BITO_ACCESS_KEY

      • Name: GIT_ACCESS_TOKEN

        • Secret: Enter your GitHub Personal Access Token (Classic) with repo access. We do not support fine-grained tokens currently. For more information, see the Prerequisites section.

      • Name: STATIC_ANALYSIS_TOOL

        • Secret: Enter the following text string as value: fb_infer,astral_ruff,mypy

      • Name: GIT_DOMAIN

        • Secret: Enter the domain name of your Enterprise or self-hosted GitHub deployment or skip this if you are not using Enterprise or self-hosted GitHub deployment.

        • Example of domain name: https://your.company.git.com

Check the above "Prerequisites" section to learn more about creating the access tokens needed to configure the Agent.

  1. Create the Workflow Directory:

    • In your repository, create a new directory path: .github/workflows.

  2. Add the Workflow File:

    • Download this test_cra.yml file from AI Code Review Agent's GitHub repo.

    • In your repository, upload this test_cra.yml file inside the .github/workflows directory.

    • Commit your changes.

Using the AI Code Review Agent

After configuring the GitHub Actions, you can invoke the AI Code Review Agent in the following ways:

  1. Automated Code Review: The agent will automatically review new pull requests as soon as they are created and post the review feedback as a comment within your PR.

  2. Manually Trigger Code Review: To start the process, simply type /review in the comment box on the pull request and submit it. This command prompts the agent to review the pull request and post its feedback directly in the PR as a comment.

    By default, the /review command generates inline comments, meaning that code suggestions are inserted directly beneath the code diffs in each file. This approach provides a clearer view of the exact lines requiring improvement. However, if you prefer a code review in a single post rather than separate inline comments under the diffs, you can include a new optional parameter: /review #inline_comment=False

It may take a few minutes to get the code review posted as a comment, depending on the size of the pull request.

Last updated

Logo

Bito Inc. (c) 2024