Skip to content

patched-codes/PRReview

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Patched PRReview Action

This GitHub Action uses patchwork-cli to automatically summarize and comment on PRs in your repository.

Features

  • Automatically reviews and summarizes pull requests
  • Generates improvement suggestions for the PR (optional)
  • Configurable summary length (long, short, none)
  • Supports various LLM providers (OpenAI, local models, or custom endpoints)
  • Automatic PR detection in GitHub Actions workflows

Usage

name: PR Review
on:
  pull_request:
    types: [opened]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: patched-codes/[email protected]
        with:
          patched_api_key: ${{ secrets.PATCHED_API_KEY }}
          # PR URL is automatically detected in pull_request events

Inputs

Required

One of the following must be provided:

Optional

  • pr_url: URL of the pull request to review (default: automatically detected in pull_request events)
  • github_token: GitHub token for creating PR comments (default: Automatically set by GitHub)
  • model: LLM model to use
  • client_base_url: Base URL for the LLM API
  • diff_suggestion: Whether to generate suggestions to improve the PR
  • diff_summary: Length of the summary (long, short, none)
  • model_temperature: Temperature parameter for the LLM
  • model_top_p: Top-p parameter for the LLM
  • model_max_tokens: Maximum tokens for the LLM response

Examples

Basic Usage

- uses: patched-codes/[email protected]
  with:
    patched_api_key: ${{ secrets.PATCHED_API_KEY }}

Manual PR Review

- uses: patched-codes/[email protected]
  with:
    patched_api_key: ${{ secrets.PATCHED_API_KEY }}
    pr_url: "https://github.com/user/repo/pull/123"
    diff_suggestion: true
    diff_summary: "long"

Using Custom Model

- uses: patched-codes/[email protected]
  with:
    openai_api_key: ${{ secrets.OPENAI_API_KEY }}
    model: "gpt-4"
    model_temperature: 0.2
    model_top_p: 0.95
    model_max_tokens: 2000

Example Comments

Here are some example comments generated with the PRReview action:

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published