https://github.com/nathannncurtis/commit-summarizer
GitHub → Ollama → Slack commit summarizer webhook service
https://github.com/nathannncurtis/commit-summarizer
llm ollama python self-hosted slack webhook
Last synced: 26 days ago
JSON representation
GitHub → Ollama → Slack commit summarizer webhook service
- Host: GitHub
- URL: https://github.com/nathannncurtis/commit-summarizer
- Owner: nathannncurtis
- License: agpl-3.0
- Created: 2026-03-13T03:38:26.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-05-05T21:33:37.000Z (about 2 months ago)
- Last Synced: 2026-05-05T23:25:59.345Z (about 2 months ago)
- Topics: llm, ollama, python, self-hosted, slack, webhook
- Language: Python
- Size: 22.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Commit Summarizer
A lightweight webhook service that listens for GitHub push events, generates plain-English summaries using a local LLM (via [Ollama](https://ollama.com)), and posts them to Slack.
Designed for teams where non-technical stakeholders want to stay informed about code changes without reading diffs.
## How it works
1. GitHub sends a push webhook to this service
2. The service verifies the HMAC-SHA256 signature
3. Commit data (messages, authors, files changed) is sent to a local Ollama model
4. An AI-generated summary is posted to a Slack channel
## Requirements
- Python 3.10+
- [Ollama](https://ollama.com) running locally with a model pulled (default: `qwen2.5:3b`)
- A Slack app with an incoming webhook (for posting summaries) and slash commands (for `/pause` and `/resume`)
- A GitHub webhook secret
## Setup
### 1. Install Ollama and pull a model
```bash
curl -fsSL https://ollama.com/install.sh | sh
ollama pull qwen2.5:3b
```
### 2. Install dependencies
```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```
### 3. Configure environment
```bash
cp .env.example .env
# Edit .env with your actual values
```
### 4. Run
```bash
python app.py
```
Or deploy as a systemd service:
```ini
[Unit]
Description=Commit Summarizer Webhook
After=network.target ollama.service
[Service]
Type=simple
User=your-user
WorkingDirectory=/path/to/commit-summarizer
ExecStart=/path/to/commit-summarizer/venv/bin/python app.py
EnvironmentFile=/path/to/commit-summarizer/.env
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
```
### 5. Configure GitHub webhook
In your repo: Settings → Webhooks → Add webhook
| Field | Value |
|---|---|
| Payload URL | `https://your-domain.com/webhook` |
| Content type | `application/json` |
| Secret | *(your GITHUB_WEBHOOK_SECRET)* |
| Events | Just the push event |
### 6. Configure Slack slash commands (optional)
To pause and resume summaries from Slack, add two slash commands to your Slack app:
1. https://api.slack.com/apps → your app → **Slash Commands** → **Create New Command**
- Command: `/pause`
- Request URL: `https://your-domain.com/slack/command`
- Save
2. Repeat for `/resume` (same Request URL)
3. **Basic Information** → copy the **Signing Secret** into `SLACK_SIGNING_SECRET`
4. Get the channel ID where the commands are allowed (right-click the channel → View channel details → bottom of the panel) and put it in `SLACK_ALLOWED_CHANNEL_ID`
5. Reinstall the app to your workspace if Slack prompts you
When paused, the service still ACKs GitHub webhooks but skips the Ollama summary and the Slack post.
## Endpoints
- `POST /webhook` — GitHub webhook receiver
- `POST /slack/command` — Slack slash command handler (`/pause`, `/resume`)
- `GET /health` — Health check (returns `paused` status)
## License
AGPL 3.0