Skip to content

avatrix1/ai-pr-description

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI PR Description Generator

GitHub Marketplace

Automatically generates detailed PR descriptions from your diffs using Claude AI. No more empty PR descriptions.

Quick Start

# .github/workflows/pr-description.yml
name: AI PR Description
on:
  pull_request:
    types: [opened]

permissions:
  contents: read
  pull-requests: write

jobs:
  describe:
    runs-on: ubuntu-latest
    steps:
      - uses: avatrix1/ai-pr-description@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

What It Does

When a PR is opened without a description (or with less than 100 characters), this action:

  1. Reads the diff and file changes
  2. Sends them to Claude AI
  3. Updates the PR with a structured description containing:
    • Summary — what the PR does and why
    • Changes — key changes grouped by area
    • Testing — how to verify the changes

If the PR already has a description longer than 100 characters, the action skips to avoid overwriting manually written descriptions.

Inputs

Input Description Required Default
anthropic_api_key Your Anthropic API key Yes
github_token GitHub token for updating the PR No ${{ github.token }}
model Claude model to use No claude-sonnet-4-20250514
max_diff_size Max diff size in chars sent to Claude No 50000

Example Output

## Summary
Adds rate limiting to the API endpoint to prevent abuse. Implements a per-key
counter with configurable limits and proper HTTP 429 responses.

## Changes
- Add in-memory usage tracking per API key
- Return X-RateLimit headers on all responses
- Add 429 response when limit exceeded

## Testing
Send repeated requests to the API endpoint and verify the rate limit headers
decrement correctly. After hitting the limit, confirm a 429 response is returned.

License

MIT

About

Auto-generate PR descriptions from diffs using Claude AI. Free GitHub Action — never write a PR description again.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors