LogoLogo
Sign inVisit bito.aiVideo Library
  • 👋Welcome to Bito
  • 🆕Getting started
  • 🛡️Privacy and security
  • 🤖AI Code Review Agent
    • Overview
    • Key features
    • Supported programming languages and tools
    • Install/run using Bito Cloud
      • Guide for GitHub
      • Guide for GitHub (Self-Managed)
      • Guide for GitLab
      • Guide for GitLab (Self-Managed)
      • Guide for Bitbucket
      • Integrate the AI Code Review Agent into the CI/CD pipeline
      • Create or customize an Agent instance
      • Clone an Agent instance
      • Delete unused Agent instances
    • Install/run as a self-hosted service
      • Prerequisites
      • CLI vs webhooks service
      • Install/run via CLI
      • Install/run via webhooks service
      • Install/run via GitHub Actions
      • Agent Configuration: bito-cra.properties File
    • Available commands
    • Chat with AI Code Review Agent
    • Implementing custom code review rules
    • Excluding files, folders, or branches with filters
    • Code review analytics
    • FAQs
  • Other Bito AI tools
    • IDE extension
      • Quick Overview
      • Installation guide
        • Installing on Visual Studio Code
        • Installing on JetBrain IDEs
        • Vim/Neovim Plugin
      • Upgrading Bito plugin
      • AI Chat in Bito
        • Keyboard shortcuts
        • Chat session history
        • Share chat session
        • Appearance settings
        • Open Bito in a new tab or window
        • Use cases and examples
      • Templates
        • Standard templates
        • Custom prompt templates
        • Diff view
      • AI that Understands Your Code
        • Overview
        • How it Works?
        • Available Keywords
        • Example Questions
        • How does Bito Understand My Code?
        • Using in Visual Studio Code
        • Using in JetBrains IDEs
        • Managing Index Size
        • FAQs
      • AI Code Completions
        • Overview
        • How it works?
        • Enable/disable settings
        • Accept/reject suggestions
        • Keyboard shortcuts
        • Supported programming languages
        • Use cases and examples
      • Basic/Advanced AI models
      • Wingman Coding Agent
        • Key features
        • Supported tools
        • Getting started
    • Bito CLI
      • Overview
      • Install or uninstall
      • Configuration
      • How to use?
      • Available commands
      • FAQs
    • Google Chrome extension
  • Help
    • 🧠Bito's AI stack
      • Embeddings
      • Vector databases
      • Indexing
      • Generative AI
      • Large Language Models (LLM)
      • LLM tokens
      • LLM parameters
      • Retrieval Augmented Generation (RAG)
      • Prompts
      • Prompt engineering
    • 👥Account and settings
      • Creating a Bito account
      • Workspace
      • Managing workspace members
      • Setting AI output language
      • Managing user access levels
      • Access key
    • 💳Billing and plans
      • Overview
      • Payment methods
      • Managing workspace plan
      • Pay for additional workspace members
      • Advanced AI requests usage
      • Billing history
      • Billing details
      • Security
      • Refund policy
      • Discounts
    • ⚒️Support and questions
      • Getting support
      • Troubleshooting
      • Is it GPT-4?
  • 🆕Changelog
  • External Links
    • Git
    • Github Issues
    • Github Discussions
    • Bito.ai
    • VS Code Marketplace
    • JetBrain Marketplace
Powered by GitBook
LogoLogo

Bito Inc. (c) 2025

On this page
  • Prerequisites
  • Installation and Configuration Steps:
  • Customizations for self-hosted GitHub
  • Using the AI Code Review Agent
  • Screenshots
  • Screenshot # 1
  • Screenshot # 2
  • Screenshot # 3

Was this helpful?

Export as PDF
  1. AI Code Review Agent
  2. Install/run as a self-hosted service

Install/run via GitHub Actions

Seamlessly integrate automated code reviews into your GitHub Actions workflows.

PreviousInstall/run via webhooks serviceNextAgent Configuration: bito-cra.properties File

Last updated 7 months ago

Was this helpful?

Prerequisites

  • Bito Access Key: Obtain your Bito Access Key.

  • 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.


Installation and Configuration Steps:

  1. Enable GitHub Actions:

    • 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.

    • Configure the following under the "Secrets" tab:

      For each secret, click the New repository secret button, then enter the exact name and value of the secret in the form. Finally, click Add secret to save it.

      • Name: BITO_ACCESS_KEY

      • Name: GIT_ACCESS_TOKEN

  • Configure the following under the "Variables" tab:

    For each variable, click the New repository variable button, then enter the exact name and value of the variable in the form. Finally, click Add variable to save it.

    • Name: STATIC_ANALYSIS_TOOL

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

    • Name: GIT_DOMAIN

      • Value: 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

    • Name: EXCLUDE_BRANCHES

      • Value: Specify branches to exclude from the review by name or valid glob/regex patterns. The agent will skip the pull request review if the source or target branch matches the exclusion list.

    • Name: EXCLUDE_FILES

      • Value: Specify files/folders to exclude from the review by name or glob/regex pattern. The agent will skip files/folders that match the exclusion list.

    • Name: EXCLUDE_DRAFT_PR

      • Value: Enter True to disable automated review for draft pull requests, or False to enable it.

  1. Create the Workflow Directory:

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

  2. Add the Workflow File:

    • In your repository, upload this test_cra.yml file inside the .github/workflows directory either in your source branch of each PR or in a branch (e.g. main) from which all the source branches for PRs will be created.

    • Commit your changes.

Customizations for self-hosted GitHub

  1. Update test_cra.ymlas below:

    • Change line from:

      • runs-on: ubuntu-latest

    • to:

      • runs-on: <label of the self-hosted GitHub Runner> e.g. self-hosted, linux etc.

  2. Update test_cra.ymlas below:

    • Replace all lines having below text:

      • uses: gitbito/codereviewagent@main

    • with:

      • uses: myorg/gitbito-bitocodereview@main

  3. Commit and push your changes in test_cra.yml .

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.

    Bito also offers specialized commands that are designed to provide detailed insights into specific areas of your source code, including security, performance, scalability, code structure, and optimization.

    • /review security: Analyzes code to identify security vulnerabilities and ensure secure coding practices.

    • /review performance: Evaluates code for performance issues, identifying slow or resource-heavy areas.

    • /review scalability: Assesses the code's ability to handle increased usage and scale effectively.

    • /review codeorg: Scans for readability and maintainability, promoting clear and efficient code organization.

    • /review codeoptimize: Identifies optimization opportunities to enhance code efficiency and reduce resource usage.

    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 the 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.

Screenshots

Screenshot # 1

AI-generated pull request (PR) summary

Screenshot # 2

Changelist showing key changes and impacted files in a pull request.

Screenshot # 3

AI code review feedback posted as comments on the pull request.

Login to your account.

Secret: Enter your Bito Access Key here. Refer to the .

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

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

Note: For more information, see .

Note: For more information, see .

Note: For more information, see .

from AI Code Review Agent's GitHub repo.

Create a self-hosted Runner using Linux image and x64 architecture as described in the .

Create a copy of Bito's repository main branch into your self-hosted GitHub organization e.g. "myorg" under the required name e.g. "gitbito-bitocodereview". In this example, now this repository will be accessible as "myorg/gitbito-bitocodereview".

Note: To improve efficiency, the AI Code Review Agent is disabled by default for pull requests involving the "main" branch. This prevents unnecessary processing and token usage, as changes to the "main" branch are typically already reviewed in release or feature branches. To change this default behavior and include the "main" branch, please .

For more details, refer to .

🤖
GitHub
Download this test_cra.yml file
GitHub documentation
gitbito/codereviewagent
contact support
Available Commands
Prerequisites
"Prerequisites"
View Guide
View Guide
guide for obtaining your Bito Access Key
Source or Target branch filter
Files and folders filter
Draft pull requests filter
GitHub Personal Access Token (Classic)
Changelist in AI Code Review Agent's feedback.