Skip to content

galihlprakoso/llm-ai-code-reviewer-action

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

LLM AI Code Reviewer - GitHub Action

License: MIT

AI Code Reviewer - GitHub Action is a powerful tool for automating code reviews using AI, with support for multiple models and dynamic code analysis. Leveraging the power of LangGraph in LangChain, this action allows for intelligent and dynamic tool usage by incorporating the concept of Agents, making the code review process more flexible and adaptive. Currently, it supports Google’s Gemini model and Groq, with more models and providers to be added in the future.

Features

🔍 Dynamic Code Review with LangGraph and Agents

This GitHub Action utilizes LangChain's LangGraph and Agent concepts to perform dynamic code reviews. The action can call multiple tools during the review process, adapting to the specific needs of the code being reviewed. This allows for more insightful and intelligent code analysis, going beyond static linting.

🌐 Multiple Model Support

The action currently supports multiple AI models, allowing for flexibility in choosing the model best suited for your codebase. Currently supported models:

  • Google Gemini
  • Groq

More models and providers will be added in future versions to ensure comprehensive support across different AI ecosystems.

🚀 Easy Integration

This action can be easily integrated into your existing CI/CD workflows. Simply add it to your GitHub Actions pipeline, and it will automatically analyze your code using the configured AI models, providing feedback and suggestions for improvement.

💬 Reply Code Review Comments

This action can automatically reply to code review comments made on pull requests. It leverages AI to generate meaningful responses, facilitating better communication and collaboration within your team.

🌍 Fetch Data from the Internet

The action can fetch relevant data from external sources such as Tavily Search, Wikipedia, and StackExchange. This feature allows the code reviewer to incorporate the latest knowledge, best practices, and relevant information, enhancing the overall review process and ensuring that the feedback provided is up-to-date and informed.

Usage

To use this action in your workflow, add the following configuration to your GitHub Actions YAML file:

name: AI Code Review

on:
  pull_request:
    types: [opened, synchronize, reopened]
    branches:
      - main
  pull_request_review_comment:
    types: [created, edited]
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

jobs:
  ai-code-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run AI Code Review
        uses: galihlprakoso/[email protected]
        with:
          ai_provider: 'GROQ'
          ai_provider_model: 'llama-3.1-70b-versatile'
          codebase_high_overview_descripton:
            'This repository is an LLM Code Reviewer Github Action that use
            typescript implemented with functional programming.'
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GOOGLE_GEMINI_API_KEY: <your gemini api key>
          GROQ_API_KEY: <your groq api key>
          TAVILY_API_KEY: <your tavily api key>

Support My Work

License

This project is licensed under the MIT License.

Template