Keeping track of activity in your GitHub repositories is essential for maintaining a healthy development workflow. Whether it’s a new pull request that needs review, a critical issue being opened, or a successful merge, knowing about it instantly can save you time.
In this guide, we will show you how to connect GitHub to AlertHub using Webhooks, so you can route these events to your preferred notification channels.
Step 1: Select Your Repository
First, navigate to GitHub and open the repository you want to monitor. This works for both public and private repositories.
Step 2: Configure the Webhook in AlertHub
Before we configure GitHub, we need to generate the destination URL in AlertHub.
- Log in to AlertHub and go to your Project.
- Locate the Access Credentials section.
- In the Custom Webhook card, let’s create a URL that formats GitHub data nicely. Fill in the following:
- Title:
GitHub Event: {{repository.name}} - Description:
User: {{sender.login}}\nAction: {{action}}\nRef: {{ref}} - Level:
info - Source:
GitHub
- Title:
- Copy the generated Webhook URL.
Pro Tip: AlertHub’s dynamic placeholders (
{{variable}}) allow you to extract any data from the GitHub JSON payload. You can customize the description to include commit messages or issue details!
Step 3: Add the Webhook to GitHub
Now, let’s tell GitHub where to send the events.
- In your GitHub repository, click on the Settings tab.
- On the left sidebar, click on Webhooks.
- Click the Add webhook button.
- In the Payload URL field, paste the URL you copied from AlertHub.
- Change Content type to
application/json. - (Optional) You can choose to trigger this webhook on just the push event, or select Let me select individual events to choose specific triggers like Pull Requests, Issues, or Releases.
- Click Add webhook.
Step 4: Configure Notification Channels (Optional)
If you haven’t already, make sure your AlertHub project is connected to the places where you want to receive these alerts.
- Go to the Connections tab in your AlertHub project.
- Connect your preferred services:
- Slack: Ideal for team channels.
- Telegram: Perfect for personal notifications on mobile.
- Email: Good for non-urgent records.
Step 5: Test It Out!
Go back to your repository and trigger an event (e.g., push a commit or open a test issue). You should instantly receive a notification with the details sourced directly from GitHub!
By integrating GitHub with AlertHub, you stop chasing updates and let the important information come to you.