Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

ENGLISH | 日本語

ai-reviewer

This is a PR review bot powered by generative AI.

Usage

Place a file (e.g., ai-reviewer.yml) in the .github/workflows directory with the following content:

name: "Run ai-reviewer"

permissions:
  pull-requests: write
  contents: read

on:
  pull_request:
    types: [opened, synchronize, reopened]
  workflow_dispatch:

jobs:
  run-review:
    runs-on: ubuntu-latest
    steps:
      - name: Gemini Review Bot
        uses: Nasubikun/ai-reviewer@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
          LANGUAGE: "Japanese"
          EXCLUDE_PATHS: "**/pnpm-lock.yaml"
          MODEL_CODE: "models/gemini-2.5-flash-preview-04-17"

Then, set your Google AI Studio Gemini API Key as GEMINI_API_KEY in your repository’s GitHub Secrets.

Configuration

You can fine-tune how reviews are performed by setting the following environment variables:

Environment Variable Required Default Value Description
EXCLUDE_PATHS false - Specify file paths or directories to exclude from reviews, separated by commas. Example: src/vendor,**/dist/*
Files matching these paths will not be reviewed.
LANGUAGE false English Specifies the language of the AI-generated comments (Example: Japanese, English).
MODEL_CODE false models/gemini-2.5-flash-preview-04-17 The Gemini model to use. Please set a valid model code that is available in AI Studio.
USE_SINGLE_COMMENT_REVIEW false false When set to true, posts all review results in a single comment. When set to false, posts multiple comments directly on the relevant parts of the diff.

About

No description, website, or topics provided.

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages