Overview
The GitHub integration allows you to:- Subscribe channels to specific repositories
- Filter events by type (push, pull_request, issues, release, deployment_status, workflow_run)
- Filter branches for push events (e.g., only
mainbranch) - Enable/disable subscriptions without deleting them
Setup
Install the GitHub App
Install the Hazel GitHub App for your organization:
- Go to Settings → Integrations → GitHub
- Click “Connect GitHub”
- Select your GitHub organization
- Choose which repositories to grant access to
- Complete the installation
Supported Events
The GitHub integration supports the following event types:| Event Type | Description | Branch Filter |
|---|---|---|
push | Commits pushed to repository | Yes |
pull_request | PR opened, updated, merged, or closed | No |
issues | Issue opened, updated, or closed | No |
release | Release published | No |
deployment_status | Deployment status changed | No |
workflow_run | GitHub Actions workflow completed | No |
Event Filtering Example
Webhook Processing
GitHub webhooks are processed by the cluster service using a durable workflow:packages/domain/src/cluster/workflows/github-webhook-workflow.ts:5-28
- Receives webhook event from GitHub
- Finds all subscriptions for the repository
- Filters by enabled events and branch (if applicable)
- Creates formatted messages in subscribed channels
- Uses the delivery ID for idempotency (duplicate deliveries are ignored)
Managing Subscriptions
List Subscriptions
Update Subscription
Disable Subscription
Temporarily disable without deleting:Delete Subscription
Message Format
GitHub events are posted as formatted messages with rich content:Push Event
Pull Request Event
Release Event
RPC Schema Reference
Create Subscription
packages/domain/src/rpc/github-subscriptions.ts:84-102
Update Subscription
packages/domain/src/rpc/github-subscriptions.ts:145-154
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
GitHubNotConnectedError | GitHub App not installed | Install the Hazel GitHub App for your organization |
GitHubSubscriptionExistsError | Channel already subscribed to repository | Update the existing subscription or delete it first |
ChannelNotFoundError | Invalid channel ID | Verify the channel exists and you have access |
UnauthorizedError | User not authorized | Must be organization admin to manage subscriptions |
Error Example
Best Practices
Use Dedicated Channels
Create separate channels for different repositories or event types:
#engineering-api-releases- Only release events#engineering-api-prs- Only PR events#deployments- Only deployment_status and workflow_run events
Next Steps
RSS Feeds
Subscribe to RSS feeds for automated content
Webhooks
Create incoming webhooks for external notifications