Integrations / GitHub
G
GitHub
Capture GitHub repository events — pushes, pull requests, issues, releases — and forward or replay them to your CI/CD or notification systems.
Auto-detected:Paggio detects GitHub events via the
x-github-event header.Setup
1
Create a Paggio endpoint
Go to Dashboard → Webhooks → New Endpoint.
Set the destination URL to your webhook handler if you want forwarding:
text
https://your-app.com/api/github/webhook2
Go to your GitHub repository settings
Navigate to your repository on GitHub → Settings → Webhooks → Add webhook.
3
Configure the webhook
Fill in the fields:
- · Payload URL — your Paggio endpoint URL
- · Content type —
application/json - · Secret — optional HMAC secret for signature verification
- · Events — choose individual events or "Send me everything"
4
Verify delivery
GitHub shows a recent deliveries list. You should also see the event appear in your Paggio dashboard immediately.
Handling GitHub events
app/api/github/webhook/route.ts
import { createHmac } from 'crypto';
export async function POST(req: Request) {
const body = await req.text();
const event = req.headers.get('x-github-event');
const signature = req.headers.get('x-hub-signature-256');
// Verify signature (optional but recommended)
if (process.env.GITHUB_WEBHOOK_SECRET) {
const expected = 'sha256=' + createHmac('sha256', process.env.GITHUB_WEBHOOK_SECRET)
.update(body).digest('hex');
if (signature !== expected) {
return Response.json({ error: 'Invalid signature' }, { status: 401 });
}
}
const payload = JSON.parse(body);
switch (event) {
case 'push':
console.log('Push to', payload.ref, 'by', payload.pusher.name);
break;
case 'pull_request':
console.log('PR', payload.action, ':', payload.pull_request.title);
break;
case 'issues':
console.log('Issue', payload.action, ':', payload.issue.title);
break;
}
return Response.json({ received: true });
}Common GitHub event types
| Event | When it fires |
|---|---|
| push | Code pushed to a branch |
| pull_request | PR opened, closed, merged, or updated |
| issues | Issue opened, closed, or commented on |
| release | Release published or pre-released |
| workflow_run | GitHub Actions workflow completes |
| check_run | CI check completes |
| star | Repository starred |
GitHub Apps vs webhooks:Paggio works with both GitHub repository webhooks and GitHub Apps webhooks. The setup is the same — just point the webhook URL at your Paggio endpoint.