GitHub Integration
Connect ButterStack with GitHub for repository access, pull request tracking, and GitHub Actions workflow monitoring.
Table of contents
- Overview
- Prerequisites
- Configuration
- Webhook Setup
- GitHub Actions Monitoring
- Features
- API Reference
- Troubleshooting
- Best Practices
- Related Guides
Overview
The GitHub integration enables your team to track code changes, monitor CI/CD pipelines, and receive real-time notifications about repository activity directly in ButterStack.
Key features include:
- Repository commit synchronization
- Pull request tracking and status updates
- GitHub Actions workflow monitoring
- Automatic task linking from commit messages
- Webhook-based real-time notifications
- Branch protection status monitoring
Prerequisites
Before configuring the GitHub integration, ensure you have:
- GitHub account with repository access
- Personal Access Token (Fine-grained or Classic)
- ButterStack project created
Configuration
Step 1: Create a Personal Access Token
- Go to GitHub Settings > Developer settings > Personal access tokens
- Choose Fine-grained tokens (recommended) or Tokens (classic)
Fine-grained Token Permissions (Recommended)
| Permission | Access Level | Purpose |
|---|---|---|
| Contents | Read-only | Access repository files and commits |
| Metadata | Read-only | Basic repository information |
| Pull requests | Read-only | Track PR status and changes |
| Actions | Read-only | Monitor workflow runs |
Classic Token Scopes
If using classic tokens, select these scopes:
repo- Full repository accessworkflow- GitHub Actions accessread:org- Organization membership (if applicable)
Step 2: Add the Integration
- Go to Project Settings > Integrations
- Click Add Integration
- Select GitHub
- Enter your configuration details
Step 3: Configure Connection Settings
| Field | Description | Required | Example |
|---|---|---|---|
| Owner/Organization | GitHub username or organization | Yes | your-org |
| Repository | Repository name | Yes | my-game |
| Default Branch | Main branch name | No | main |
| Personal Access Token | Token from Step 1 | Yes | ghp_xxxx... |
| Enable Actions Monitoring | Track GitHub Actions workflows | No | true |
Step 4: Test Connection
Click Test Connection to verify your credentials and repository access.
Webhook Setup
To receive real-time updates, configure webhooks in your GitHub repository:
Creating the Webhook
- Go to your repository > Settings > Webhooks
- Click Add webhook
- Configure the webhook:
| Field | Value |
|---|---|
| Payload URL | https://app.butterstack.com/webhooks/github?token=YOUR_TOKEN |
| Content type | application/json |
| SSL verification | Enable (recommended) |
Recommended Events
Select these events for full integration:
- Push - Commit notifications
- Pull requests - PR opened, closed, merged
- Workflow runs - GitHub Actions status
- Check runs - CI status checks
- Deployment status - Deployment notifications
Webhook Secret (Optional)
For additional security:
- Generate a secret:
openssl rand -hex 32 - Add to GitHub webhook configuration
- Add to ButterStack integration settings
GitHub Actions Monitoring
When “Enable GitHub Actions monitoring” is enabled, ButterStack tracks:
| Metric | Description |
|---|---|
| Workflow Status | In progress, success, failure, cancelled |
| Build Duration | Time from start to completion |
| Run History | Historical workflow executions |
| Deployment Status | Environment deployment state |
Linking Workflows to Builds
ButterStack can associate GitHub Actions runs with your build pipeline:
- Add the repository name to your ButterStack build configuration
- GitHub Actions runs will automatically link to corresponding builds
- View combined status in the ButterStack dashboard
Features
Commit Synchronization
When commits are pushed:
- ButterStack receives the webhook notification
- Fetches commit details via GitHub API
- Creates commit records with:
- Commit SHA and message
- Author information
- Changed files
- Timestamp
- Links to tasks if task keys are found in the message
- Optionally triggers downstream builds
Task Linking
Include task keys in your commit messages:
PROJ-123: Updated character animations
- Improved walk cycle
- Fixed blending issues
ButterStack automatically links the commit to task PROJ-123 in Jira/Linear/Trello.
Pull Request Tracking
Monitor pull request lifecycle:
- Opened - New PR created
- Updated - New commits pushed
- Reviewed - Review submitted
- Merged - PR merged to target branch
- Closed - PR closed without merge
Build Triggering
Include trigger tags in your commit message:
#ci- Trigger default build job#build- Trigger default build job#deploy- Trigger deployment workflow
Example:
PROJ-456: Added new weapon models #ci
- Added assault rifle mesh
- Updated weapon materials
API Reference
Webhook Endpoint
POST /webhooks/github?token={webhook_token}
Headers:
X-GitHub-Event- Event type (push, pull_request, etc.)X-Hub-Signature-256- HMAC signature (if secret configured)
Integration Status
GET /api/v1/integrations/{integration_id}/status
Returns connection health and last sync time.
Troubleshooting
Connection Failed
Error: Bad credentials or 401 Unauthorized
- Verify your Personal Access Token is valid
- Check the token hasn’t expired
- Ensure token has required permissions/scopes
- Verify repository owner and name are correct
Repository Not Found
Error: 404 Not Found
- Check repository owner/name spelling (case-sensitive)
- Ensure your token has access to the repository
- For private repos, verify token has
reposcope
Webhooks Not Received
If webhooks aren’t being processed:
- Check GitHub webhook delivery logs:
- Repository > Settings > Webhooks > Recent Deliveries
- Verify webhook URL is correct
- Ensure webhook token matches integration settings
- Check for SSL certificate issues
Rate Limiting
Error: 403 rate limit exceeded
- GitHub API has rate limits (5,000 requests/hour with token)
- Consider reducing polling frequency
- Use webhooks instead of polling when possible
Actions Monitoring Not Working
- Verify token has
workflowscope (classic) or Actions read permission (fine-grained) - Check repository has GitHub Actions enabled
- Ensure workflows exist in
.github/workflows/
Best Practices
- Use Fine-grained Tokens - More secure with minimal required permissions
- Enable Webhooks - Real-time updates are more reliable than polling
- Configure Webhook Secret - Adds security verification layer
- Use Service Account - Don’t use personal credentials for team integrations
- Monitor Rate Limits - Stay within GitHub API limits
- Regular Token Rotation - Rotate tokens periodically for security