A universal webhook service that forwards GitHub events to Discord with beautiful, information-rich embeds.
Deploy once, use across all your repositories, completely free, open-source, serverless, and scalable.
- Universal Service - One endpoint for all your GitHub repositories
- Rich Discord Embeds - Beautiful, well-formatted messages with all relevant information
- Accurate Commit Stats - Shows real line additions/deletions using GitHub API (supports private repos)
- Multiple Event Support - Handles pushes, pull requests, issues, stars, forks, releases, and more
- Zero Configuration - Just add your Discord webhook URL and you're ready to go
- Ready for Vercel - Deploy instantly with Vercel's serverless platform
| Event | Description |
|---|---|
| Push | New commits pushed to a branch |
| Pull Request | PR opened, closed, merged, or reopened |
| Issues | Issue opened, closed, assigned, labeled |
| Issue Comments | New comments on issues |
| Stars | Repository starred or unstarred |
| Forks | Repository forked |
| Releases | Release published, created, edited, or deleted |
| Branch/Tag Creation | New branches or tags created |
| Branch/Tag Deletion | Branches or tags deleted |
| Watching | User started watching repository |
| Collaborators | New collaborator added |
| Commit Comments | Comments on commits |
- GitHub sends a webhook event to your Vercel endpoint
- The service processes the event and fetches accurate commit stats via GitHub API (if needed)
- Creates a formatted Discord embed with all relevant information
- The embed is sent to your configured Discord channel
Or manually:
git clone https://github.com/KaloudasDev/github-webhook.git
cd github-webhook
vercel deployAdd these environment variables to your Vercel project:
| Variable | Description | Required |
|---|---|---|
DISCORD_GITHUB_WEBHOOK_URL |
Your Discord webhook URL | Yes |
GITHUB_TOKEN |
GitHub Personal Access Token (For Private Repos) | Optional* |
*Required only if you want accurate commit stats for private repositories. Public repos work without it.
- Go to your Discord server → Channel Settings → Integrations → Webhooks
- Create a new webhook named "GitHub"
- Copy the webhook URL
If you plan to use this service with private repositories, you need a GitHub token:
- GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Generate new token (classic)
- Note:
github-webhook-service - Expiration: No expiration (or as preferred)
- Scopes: Select
repo(Full control of private repositories) - Generate and copy the token (e.g.,
ghp_xxxxxxxxxxxx)
Important
The token is required only for private repositories. Public repos work without it.
For each repository you want to monitor:
- Go to your GitHub repository → Settings → Webhooks → Add webhook
- Payload URL:
https://your-project.vercel.app/api/github-webhook - Content type:
application/json - Secret: Leave empty (optional)
- Events: Select "Let me select individual events" and choose:
- Push
- Pull Requests
- Issues (Optional)
- Stars (Optional)
- Click Add webhook
KaloudasDev/github-webhook
[abc1234] Update README — KaloudasDev
Files: 1
Additions: +5 Lines
Deletions: -2 Lines
GitHub
KaloudasDev/github-webhook - Pull Request Opened
Add new feature
Branch: feature → main
Commits: 3
Changes: +156 / -23 Lines
GitHub
KaloudasDev/github-webhook - Issue Opened
Bug: Login not working
Issue: #42
Comments: 2
GitHub
You can test if your service is running:
curl https://your-project.vercel.app/api/github-webhookExpected response:
{
"status": "ok",
"message": "GitHub webhook service is running",
"usage": "Send POST requests with GitHub webhook events",
"endpoints": ["/api/github-webhook (POST only)"]
}To test with a real commit:
# Add a test line to any file
echo "// test" >> your-file.js
git add your-file.js
git commit -m "Test: Verify commit stats"
git pushCheck your Discord channel for the embed with accurate stats.
github-webhook/
├── api/
│ └── github-webhook.js # Main webhook handler
├── package.json # Dependencies and metadata
├── vercel.json # Vercel configuration
└── README.md # This file
| Variable | Purpose | Required |
|---|---|---|
DISCORD_GITHUB_WEBHOOK_URL |
Discord webhook destination | Yes |
GITHUB_TOKEN |
GitHub API token for private repo stats | For private repos only |
- Ensure
GITHUB_TOKENis set correctly in Vercel - Verify token has
reposcope - For public repos, token is not required
- Verify the URL is
https://your-project.vercel.app/api/github-webhook - Check that the deployment was successful
- Verify
DISCORD_GITHUB_WEBHOOK_URLis correct - Check Vercel logs for errors
MIT © KaloudasDev
Contributions are welcome! Please ensure:
- Code follows existing patterns
- All events are handled properly
- Discord embeds remain clean and informative