This GitHub Action uses patchwork-cli to automatically summarize and comment on PRs in your repository.
- 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
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
One of the following must be provided:
patched_api_key
: Patched API key for the LLM (Get an API key)openai_api_key
: OpenAI API key for the LLM (Get an API key)
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 useclient_base_url
: Base URL for the LLM APIdiff_suggestion
: Whether to generate suggestions to improve the PRdiff_summary
: Length of the summary (long, short, none)model_temperature
: Temperature parameter for the LLMmodel_top_p
: Top-p parameter for the LLMmodel_max_tokens
: Maximum tokens for the LLM response
- uses: patched-codes/[email protected]
with:
patched_api_key: ${{ secrets.PATCHED_API_KEY }}
- 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"
- 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
Here are some example comments generated with the PRReview action:
MIT
Contributions are welcome! Please feel free to submit a Pull Request.