AI-powered GitHub Action that automatically generates clear, professional Pull Request descriptions based on your code diff — powered by OpenAI's GPT-4.
- 🔍 Analyzes
git diffbetween the PR branch and base - 🧠 Summarizes changes using OpenAI GPT-4o
- 💬 (Optional) Posts generated description as a PR comment
- 🛠️ Easy to drop into any CI/CD workflow
Add this to your .github/workflows/pr-whisperer.yml:
name: PR Whisperer AI
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: read
pull-requests: write
jobs:
whisper:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run PR Whisperer AI
uses: viniciustakedi/PR-Whisperer-AI@main
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}In your repository:
- Go to Settings → Secrets → Actions
- Click New repository secret
- Name: OPENAI_API_KEY
- Value: your actual OpenAI API key
- Fetches the base branch and current HEAD
- Computes the diff using git merge-base and git diff
- Sends the diff to OpenAI's API with a prompt
- Prints the AI-generated PR description in the logs (Coming soon) Optionally posts it to the PR body or comments
Install locally (optional)
pip install -r requirements.txt
python main.py