A production-ready Node.js Express application that acts as a secure GitHub webhook to Discord message transformer.
- Handles GitHub webhook events securely using SHA-256 HMAC verification.
- Transforms GitHub webhook payloads to nicely styled Discord rich embeds.
- Supported Events:
push,fork,watch(stars).
-
Clone the repository.
-
Install dependencies:
npm install -
Configure Environment Variables: Rename
.env.exampleto.envand fill in the details:PORT=3000 DISCORD_WEBHOOK_URL=your-discord-webhook-url GITHUB_WEBHOOK_SECRET=your-random-secret NODE_ENV=development
-
Start the server:
npm startFor development with live reload:npm run dev
-
POST /github Receives payloads from GitHub.
-
GET /health Checks application health.
This server natively implements GitHub's x-hub-signature-256 webhook verification.
A valid secret is securely hashing the RAW request body payloads.