title: "Slack Integration"
OpenCodeHub's Slack integration sends real-time notifications for repository events and allows quick actions directly from Slack channels.
Supported Events
| Event | Notification | Actions |
|---|---|---|
| Pull Request opened | Title, author, branch | Review, Approve |
| PR approved / changes requested | Reviewer, status | View diff |
| PR merged | Merger, commit count | View commit |
| CI failed | Job name, failure step | View logs, Retry |
| Issue created / assigned | Title, assignee | View, Comment |
| Release published | Version, changelog | View release |
Setup
1. Create a Slack App
- Go to api.slack.com/apps
- Click Create New App → From scratch
- Name it "OpenCodeHub" and select your workspace
2. Configure Permissions
Add the following Bot Token Scopes:
chat:write
chat:write.public
im:write
users:read
files:write
3. Install App to Workspace
- Click Install to Workspace
- Copy the Bot User OAuth Token (starts with
xoxb-)
4. Configure OpenCodeHub
Add to your .env:
SLACK_ENABLED=true
SLACK_BOT_TOKEN=xoxb-your-token-here
SLACK_SIGNING_SECRET=your-signing-secret
Or configure via the web UI:
- Go to Organization Settings → Integrations → Slack
- Paste the bot token and signing secret
- Click Test Connection
5. Subscribe Repositories
Per-repository settings:
- Go to Repository → Settings → Integrations
- Enable Slack notifications
- Choose channel and events
Slash Commands
/och prs [repo] List open PRs
/och review <pr-number> Quick review a PR
/och queue [repo] Show merge queue status
/och issues [repo] List open issues
Troubleshooting
"Notifications not appearing"
- Verify the bot is invited to the channel (
/invite @OpenCodeHub) - Check repository subscription settings
- Verify
SLACK_BOT_TOKENis correct
"Too many notifications"
- Enable notification batching
- Filter by event type in repository settings
- Use
@mentionsonly mode for noisy repos