PR Summarizer
ActionsAutomatically generates and updates pull request descriptions using AI (OpenAI/Anthropic)
v1.0.5
LatestBy meido-ai
Tags
(2)A GitHub Action that automatically generates pull request descriptions using AI (OpenAI or Anthropic). This action analyzes the changes in your pull request and creates a clear, concise description that helps other engineers understand the changes.
- Automatically generates PR descriptions using AI
- Supports both OpenAI (GPT-4) and Anthropic (Claude) models
- Preserves existing PR descriptions and appends AI-generated summaries
- Automatically updates AI summaries on subsequent runs
- Easy to configure and customize
- Clear headers for AI-generated content
When the action runs:
- If there's no existing PR description, it creates one with an AI-generated summary
- If there's an existing description:
- Preserves the original content
- Appends or updates the AI-generated summary
- Clearly marks AI-generated content with "🤖 PR Summarizer" header
Add this action to your workflow file (e.g., .github/workflows/pr-description.yml
):
name: Generate PR Description
on:
pull_request:
types: [opened]
permissions:
pull-requests: write
contents: read
jobs:
generate-description:
runs-on: ubuntu-latest
steps:
- uses: meido-ai/pr-summarizer@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
model-provider: 'anthropic'
model: 'claude-3-sonnet-20240229'
# Optional: Use OpenAI instead
# openai-api-key: ${{ secrets.OPENAI_API_KEY }}
Input | Description | Required | Default |
---|---|---|---|
github-token |
GitHub token for API access | Yes | N/A |
openai-api-key |
OpenAI API key | Yes† | N/A |
anthropic-api-key |
Anthropic API key | No‡ | N/A |
model-provider |
AI model provider to use (openai or anthropic ) |
No | openai |
model |
Model to use (e.g., gpt-4 for OpenAI or claude-3-sonnet-20240229 for Anthropic) |
No | gpt-4 |
† OpenAI API key is required unless using Anthropic (see note below)
‡ Anthropic API key is required if model-provider
is set to anthropic
Note on API Keys:
- You must provide either an OpenAI API key or an Anthropic API key
- By default, OpenAI will be used and requires an OpenAI API key
- To use Anthropic:
- Set
model-provider
toanthropic
- Provide an
anthropic-api-key
- Optionally remove the
openai-api-key
- Set
- Add the workflow file to your repository
- Set up the required secrets in your repository:
- For OpenAI: Add
OPENAI_API_KEY
secret - For Anthropic: Add
ANTHROPIC_API_KEY
secret
- For OpenAI: Add
- The action will run automatically when PRs are opened
To modify or contribute to this action:
- Clone the repository
- Install dependencies:
npm install
- Make your changes
- Build the action:
npm run build
- Test your changes:
npm test
PR Summarizer is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.