This bot receives GitHub webhook notifications for new issues and forwards them to Discord channels based on issue labels. Only bug and feature issue types are supported.
- ✅ Routes GitHub issue notifications to specific Discord channels:
- 🐛 Bug issues → Bug Discord channel
- ✨ Feature/Enhancement issues → Feature Discord channel
- ✅ Rich Discord embeds with issue details:
- Issue title and description
- Repository name
- Creator information and avatar
- Issue type badge
- Direct link to the issue
- ✅ Build information logging (commit hash, message, date, branch)
- ✅ Comprehensive logging and monitoring
- ✅ Health check endpoint
- ✅ Automatic Docker builds via GitHub Actions
You only need two Discord webhook URLs:
DISCORD_WEBHOOK_BUG=your_bug_webhook_url
DISCORD_WEBHOOK_FEATURE=your_feature_webhook_urlThe bot is available as a pre-built Docker image from GitHub Container Registry:
# Pull the latest image
docker pull ghcr.io/slamanna212/devmessenger:latest
# Run the container
docker run -d \
--name github-discord-bot \
-p 5000:5000 \
-e DISCORD_WEBHOOK_BUG="your_bug_webhook_url" \
-e DISCORD_WEBHOOK_FEATURE="your_feature_webhook_url" \
--restart unless-stopped \
ghcr.io/slamanna212/devmessenger:latest-
Clone this repository:
git clone https://github.com/slamanna212/DevMessenger.git cd DevMessenger -
Create a
.envfile:DISCORD_WEBHOOK_BUG=your_bug_webhook_url DISCORD_WEBHOOK_FEATURE=your_feature_webhook_url
-
Build and run:
docker build -t github-discord-bot . docker run -d \ --name github-discord-bot \ -p 5000:5000 \ --env-file .env \ github-discord-bot
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile (see format above) -
Run the bot:
python app.py
-
For Bug Channel:
- Go to your Discord server's bug reports channel
- Click the gear icon ⚙️ next to the channel name
- Go to "Integrations" → "Create Webhook"
- Name it "GitHub Bug Reports" and copy the webhook URL
-
For Feature Channel:
- Go to your Discord server's feature requests channel
- Follow the same steps as above
- Name it "GitHub Feature Requests" and copy the webhook URL
Configure GitHub to send webhooks when issues are created and labeled:
- Go to your GitHub repository
- Click "Settings" → "Webhooks" → "Add webhook"
- Configure:
- Payload URL:
http://your-server:5000/webhook - Content type:
application/json - Events: Select "Let me select individual events" and choose "Issues"
- Payload URL:
- Click "Add webhook"
| Issue Label | Discord Channel | Description |
|---|---|---|
bug |
Bug webhook | Issues reporting bugs or problems |
feature |
Feature webhook | Feature requests and enhancements |
enhancement |
Feature webhook | Same as feature |
| Other types | ❌ Not supported | Returns error message |
The bot automatically displays build information on startup, including:
- Git commit hash and message
- Build date and branch
- Webhook configuration status
This information is baked into the code during Docker build, ensuring it can't be overridden by container orchestration tools.
🔧 Webhook Configuration:
├─ Bug webhook: ✓ Configured
└─ Feature webhook: ✓ Configured
📋 Build Information:
├─ Branch: main
├─ Commit: a1b2c3d4...
├─ Message: Add new feature
└─ Date: 2025-01-15T14:30:25-05:00
🚀 Starting GitHub to Discord notification bot
🌐 Server listening on http://0.0.0.0:5000
📥 Webhook: issues | ID: 12345678
📋 Issue #42 in owner/repo | Action: typed
🏷️ Processing: #42 'Bug in login system...' | Type: bug
📤 Sending → bug channel: #42 'Bug in login system...' by @username
✅ Discord → bug: Issue #42 delivered (HTTP 200)
✅ Complete: Issue #42 → Discord (HTTP 200)
# View all logs
docker logs github-discord-bot
# Follow logs in real-time
docker logs -f github-discord-bot
# View last 100 lines
docker logs --tail 100 github-discord-botThe bot provides a health check endpoint:
curl http://localhost:5000/health
# Response: {"status": "healthy"}When an issue is created with an unsupported label, the bot will:
- Log a warning message
- Return HTTP 400 with clear error message
- Not send any Discord notification
If a required webhook URL is not configured:
- Startup logs will show "✗ Not configured"
- Runtime will return appropriate error messages
# View logs
docker logs github-discord-bot
# Follow logs in real-time
docker logs -f github-discord-bot
# Stop the container
docker stop github-discord-bot
# Remove the container
docker rm github-discord-bot
# Restart the container
docker restart github-discord-bot
# Update to latest version
docker pull ghcr.io/slamanna212/devmessenger:latest
docker stop github-discord-bot
docker rm github-discord-bot
# Run with new image (use your run command from setup)The project includes automated GitHub Actions workflows:
- Triggers: Push to main/dev, Pull Requests, Version tags
- Features:
- Extracts git information during build
- Builds multi-architecture Docker images
- Pushes to GitHub Container Registry (GHCR)
- Uses aggressive caching prevention (
no-cache: true)
latest: Most recent build from main branchmain: Same as latestdev: Development branch buildsv*.*.*: Version release tagssha-*: Specific commit builds
# Use latest stable
docker pull ghcr.io/slamanna212/devmessenger:latest
# Use specific version
docker pull ghcr.io/slamanna212/devmessenger:v1.2.3
# Use development version
docker pull ghcr.io/slamanna212/devmessenger:devWhen running locally, the bot will show:
📋 Build Information: Development build (git info not available)
Git information is automatically captured during Docker builds. The build process:
- Extracts current git commit, message, date, and branch
- Generates
build_info.pywith this information baked into the code - App imports build information from the generated file (not environment variables)
- This prevents container orchestration tools from overriding build metadata
# Tag a new version
git tag v1.2.3
git push origin v1.2.3
# GitHub Actions will automatically build and push the tagged version-
"No webhook configured for this issue type"
- Issue was labeled with unsupported type
- Only
bug,feature, andenhancementare supported
-
Webhook not receiving notifications
- Check GitHub webhook settings
- Ensure your server is accessible from the internet
- Verify webhook URL is correct
-
Container shows old git information
- Ensure you're pulling the latest image:
docker pull ghcr.io/slamanna212/devmessenger:latest - Check the image tag you're running
- Ensure you're pulling the latest image:
For local development without Docker:
- The
build_info.pyfile provides fallback values - Logs will show "Development build"
- All functionality works the same
- Inbound: Port 5000 (HTTP) accessible from GitHub's webhook IPs
- Outbound: HTTPS access to Discord's API (
discord.com)
For local testing, consider using ngrok to expose your local server.
MIT License - Feel free to modify and distribute!