GitHub
Middleware's GitHub integration enables you to track and monitor key events from your repositories, such as code pushes, commits, pull requests, dependabot alert, and build failures. It ensures seamless collaboration by linking code events to incidents, providing real-time insights, and enhancing project security. With Middleware, your team can monitor repository health, detect build failures, and stay updated on code changes effortlessly.
Prerequisites
Before setting up the GitHub integration, ensure the following requirements are met:
1 Middleware Account
Middleware Account with admin
level access
2 GitHub Account:
GitHub Account with admin
level access to the repository you wish to integrate.
3 Repository Permissions:
Ensure the repository settings allow for webhook configuration.
Setup
Follow these steps to set up GitHub integration with Middleware account.
- Log in to your GitHub account and navigate to the Settings > Code and Automation > Webhooks.
- Click on Add webhook.
- In the Payload URL field, paste the Middleware's Intake Webhook URL, appears as:
https://<MW_UID>.middleware.io:443/v1/integration/github?mw_api_key=<MW_API_KEY>
- Set the Content type to
application/json
. - Choose the events you want to track from the following list:
- Branch or Tag Creation
- Branch or Tag Deletion
- Commit Comments
- Dependabot Alert
- Discussion
- Discussion Comment
- Issue Comments
- Issues
- Public - Visibility Changes
- Pull Request Review Comments
- Pull Request Reviews
- Pull Requests
- Pushes & Commits
- Releases
- Repositories
- Security and Analyses
- Team Adds
- After saving the changes on the GitHub side, specify your desired repositories and branches on the Middleware side to filter the events you want to track.
Features
- Real-Time Monitoring:
- Tracks pushes, commits, and pull requests instantly.
- Build Failure Detection:
- Detects and alerts on build failures or system issues caused by code changes.
- Enhanced Collaboration:
- Facilitates discussions and reviews directly within your workflow.
- Incident Management:
- Links code events to new or existing incidents.
- Security Monitoring:
- Monitors repository vulnerability alerts and collaborator changes.
GitHub Event Mappings
Middleware maps all supported GitHub events to corresponding log types on Middleware's logs screen. Each event is categorized by its action type and assigned a log level, such as info, warning, error, or debug. This ensures that events are appropriately flagged and prioritized for review. Below is an example of how some events are mapped:
- Create Branch/Tag Event: Marked as Info log.
- Delete Branch/Tag Event: Marked as Error log.
- Pull Request Event:
opened
: Marked as Info log.closed
: Marked as Error log.locked
,unlocked
,unassigned
,unlabeled
: Marked as Warning log.ready_for_review
,review_requested
,review_request_removed
: Marked as Debug log.
- Push Event: Marked as Info log.
- Issue Event: Marked as Error log.
- Release Event:
created
,published
,released
: Marked as Info log.edited
: Marked as Warning log.deleted
: Marked as Error log.
Troubleshooting
Common Issues and Solutions
- Webhook Not Triggering Events:
- Verify the Payload URL in GitHub settings.
- Ensure the events you wish to track are selected.
- Missing Insights on Middleware Dashboard:
- Check if the webhook is active in GitHub.
- Verify that the repository and branch names are correctly entered in Middleware.
- Security Alerts Not Captured:
- Ensure security-related events like
Dependabot Alerts
andSecurity and Analyses
are enabled.
- Incorrect Data Format:
- Set the Content type to
application/json
when configuring the webhook.
Need assistance or want to learn more about Middleware? Contact our support team in Slack.