AI-powered PR summaries to Slack using GitHub secrets for secure credential management.
No need to create your own repository - just use the public action with GitHub secrets.
The action uses GitHub secrets for secure credential storage. You need to add these secrets to any repository where you want to use the action:
Required Secrets:
OPENAI_API_KEY: Your OpenAI API key (starts withsk-)SLACK_WEBHOOK: Your Slack webhook URL (starts withhttps://hooks.slack.com/)
How to add secrets:
- Go to your repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Add each secret with the exact names above
In any repo, create .github/workflows/pr-summary.yml:
name: PR Summary
on:
pull_request:
types: [closed]
jobs:
summary:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: ionworks/pr-summary-action@v1.4
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}- uses: ionworks/pr-summary-action@v1.4
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}- uses: ionworks/pr-summary-action@v1.4
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
model: "gpt-4"To post to a different channel, create a separate webhook for that channel in Slack and use it:
- uses: ionworks/pr-summary-action@v1.4
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK_FRONTEND }} # Different webhook for #frontend- uses: ionworks/pr-summary-action@v1.4
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
model: "gpt-4"- Triggers: When a PR is merged
- Analyzes: Gets PR title, description, diff, and author information
- Summarizes: Uses OpenAI to generate technical and marketing summaries with author context
- Posts: Sends formatted message to Slack with PR author, branch info, and link
- ✅ Secure credential management - Uses GitHub secrets for secure storage
- ✅ One-line setup - Works across all repos instantly
- ✅ AI-powered - Technical and marketing summaries with author context
- ✅ Rich Slack integration - Formatted messages with PR author, branch info, and buttons
- ✅ Comprehensive debugging - Full GitHub event logging for troubleshooting
- ✅ Author information - Includes PR author and merge details in summaries
- ✅ Customizable - Choose AI model and different webhooks for different channels
The action uses GitHub secrets passed as inputs for secure credential storage. Each repository needs to have the required secrets configured in its settings. This ensures credentials are:
- Encrypted and secure
- Repository-specific
- Not exposed in logs or code
- Managed through GitHub's built-in security features
- Explicitly passed (no hidden dependencies)
✅ Explicit: Clear what secrets the action needs ✅ Flexible: Repositories can use different secret names ✅ Reusable: Works across different organizations ✅ Secure: Follows GitHub Actions best practices ✅ Transparent: Workflow files show exactly what's being passed
- Use GPT-4 for critical repositories that need high-quality summaries
- Create different webhooks for different teams/projects (each webhook targets a specific channel)
- Add repo-specific logic in
summarize.pyusingos.environ['GITHUB_REPOSITORY'] - Monitor your OpenAI API usage to manage costs
- GitHub repository with configured secrets
- OpenAI API key
- Slack webhook URL