A GitHub Action that generates weekly summaries of code changes using OpenAI and sends them to Slack.
- Analyzes git commits over a specified time period
- Uses OpenAI's models to generate human-readable summaries
- Posts summaries directly to a Slack channel
- Configurable analysis period and model selection
Add this action to your GitHub workflow:
name: Weekly Code Summary
on:
schedule:
- cron: "0 10 * * 1" # Runs at 10:00 AM every Monday
workflow_dispatch: # Allows manual triggering
jobs:
summarize:
runs-on: ubuntu-latest
steps:
- uses: gentrace/git-summarizer@v1
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: "C088V1U72BC" # Required - Slack channel ID
days_to_analyze: "7" # Optional, defaults to 7
model: "o1" # Optional, defaults to o1| Input | Description | Required | Default |
|---|---|---|---|
openai_api_key |
OpenAI API key for generating summaries | Yes | - |
slack_bot_token |
Slack Bot Token for sending messages | Yes | - |
slack_channel |
Slack channel ID (e.g., C088V1U72BC) | Yes | - |
days_to_analyze |
Number of days of history to analyze | No | 7 |
model |
OpenAI model to use for summarization | No | o1 |
- Create an OpenAI API key at https://platform.openai.com
- Create a Slack Bot Token at https://api.slack.com/apps
- Add both tokens as secrets in your GitHub repository
- Get your Slack channel ID (right-click channel → Copy channel ID)
- Add the workflow file to your repository at
.github/workflows/weekly-summary.yml - Make sure your Slack bot has been invited to the target channel
MIT