CriticWave Action

GitHub Marketplace

CriticWave Action is a GitHub Action that analyzes your Pull Requests (PRs) using the Gemini API to provide detailed code reviews. It posts comments directly on the PR with identified issues, severity, explanations, and suggested fixes — all powered by AI.

🐙 CriticWave GitHub Repository


Experimental / Work In Progress

🚧 This project is currently in an experimental state and a work in progress. This is the initial version, so expect frequent updates, improvements, and possible breaking changes.
Please provide feedback and report issues on the GitHub repository.

Features


Usage

Inputs

Name Description Required Default
github-token GitHub token to post comments Yes
gemini-api-key Your Gemini API key Yes
pr-style-guide Style guide prompt for review Yes
model Gemini model to use for review API No gemini-2.0-flash

Example Workflow


name: PR Review with CriticWave

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

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run CriticWave PR Review
        uses: dprakash2101/criticwave-action@v1.0.0
        with:
          github-token: ${{ secrets.ACCESS_TOKEN }}
          gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
          pr-style-guide: |
            Please review the code for best practices, readability, security, and performance.
            Follow the company style guide: https://example.com/style-guide
          model: gemini-2.0-flash
    

How It Works

  1. The action triggers on pull request events.
  2. It fetches the PR diff and all changed files at the PR head commit.
  3. It sends the diff, full changed files, style guide prompt, and other metadata to the Review API.
  4. The Review API (powered by Gemini API) analyzes the code, generates a structured review response with issues and fixes.
  5. The action formats the response into a Markdown comment and posts it on the PR.
  6. Developers get an AI-powered code review directly within GitHub.
Architecture Diagram

Warning

⚠️ Important: Never hardcode your github-token or gemini-api-key directly in your workflow or code.
Always store them securely as GitHub Secrets and reference them using secrets.<NAME> in your workflow files.
Exposing these keys publicly can lead to security risks and unauthorized usage.

Advanced Notes


Sample PR Review

You can view a sample automated PR review here:
CriticWave Sample Review


Troubleshooting


Author

Devi Prakash


License

This project is licensed under the MIT License. See the LICENSE file for details.