{"id":22199639,"url":"https://github.com/brawl345/git-telegram-webhook","last_synced_at":"2026-05-11T02:05:21.197Z","repository":{"id":241161906,"uuid":"804456701","full_name":"Brawl345/git-telegram-webhook","owner":"Brawl345","description":"Receives GitHub webhook events and sends a formatted message to a Telegram chat","archived":false,"fork":false,"pushed_at":"2024-05-22T17:04:06.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T02:43:37.713Z","etag":null,"topics":["git","github","golang","telegram","webhook"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Brawl345.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-22T16:12:42.000Z","updated_at":"2024-12-06T20:03:37.000Z","dependencies_parsed_at":"2024-05-22T19:30:21.818Z","dependency_job_id":"892c49a1-bb97-48d9-a327-009639101446","html_url":"https://github.com/Brawl345/git-telegram-webhook","commit_stats":null,"previous_names":["brawl345/git-telegram-webhook"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brawl345%2Fgit-telegram-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brawl345%2Fgit-telegram-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brawl345%2Fgit-telegram-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brawl345%2Fgit-telegram-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brawl345","download_url":"https://codeload.github.com/Brawl345/git-telegram-webhook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245372219,"owners_count":20604489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","github","golang","telegram","webhook"],"created_at":"2024-12-02T15:16:04.788Z","updated_at":"2026-05-11T02:05:21.190Z","avatar_url":"https://github.com/Brawl345.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Telegram Webhook\n\nCloudflare Worker that receives GitHub webhook events and sends formatted messages to a Telegram chat.\n\n## Supported Webhook Events\n\n- [`ping`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#ping)\n- [`push`](https://docs.github.com/en/webhooks/webhook-events-and-payloads#push)\n\n## Setup\n\n### 1. Install dependencies\n\n```bash\nbun ci\n```\n\n### 2. Set secrets\n\n```bash\nbunx wrangler secret put TELEGRAM_BOT_TOKEN\nbunx wrangler secret put GITHUB_WEBHOOK_SECRET\n```\n\n| Secret                  | Description                                                            |\n|-------------------------|------------------------------------------------------------------------|\n| `TELEGRAM_BOT_TOKEN`    | API token of your Telegram bot                                         |\n| `GITHUB_WEBHOOK_SECRET` | Secret key used to verify GitHub webhook payloads                      |\n\n### 3. Deploy\n\n```bash\nbun run deploy\n```\n\nYou will receive a URL of the form `https://gitwebhook.\u003cyour-subdomain\u003e.workers.dev`.\n\n### 4. Configure GitHub webhook\n\nIn your GitHub repo under **Settings → Webhooks → Add webhook**:\n\n- **Payload URL:** `https://gitwebhook.\u003cyour-subdomain\u003e.workers.dev?chat_id=\u003cYOUR_TELEGRAM_CHAT_ID\u003e`\n- **Content type:** `application/json`\n- **Secret:** Your `GITHUB_WEBHOOK_SECRET`\n- **Events:** Just the `push` event.\n\n---\n\n## Local Development\n\n### Secrets for local development\n\nWrangler reads local secrets from a `.dev.vars` file (not committed). Copy the template and fill it in:\n\n```bash\ncp .dev.vars.example .dev.vars\n```\n\n```ini\n# .dev.vars\nTELEGRAM_BOT_TOKEN=your-bot-token\nGITHUB_WEBHOOK_SECRET=your-secret\n# Optional: skip signature verification (local only!)\nDANGEROUS_SKIP_GITHUB_WEBHOOK_SECRET_CHECK=true\n```\n\n### Start the worker locally\n\n```bash\nbun run dev\n```\n\nThe worker will be available at `http://localhost:8787`.\n\n### Testing webhooks locally\n\nSince GitHub cannot reach a local URL, the easiest approach is `curl`.\n\n**Option A – Skip signature verification** (`DANGEROUS_SKIP_GITHUB_WEBHOOK_SECRET_CHECK=true` in `.dev.vars`):\n\n```bash\ncurl -X POST \"http://localhost:8787?chat_id=YOUR_CHAT_ID\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-GitHub-Event: ping\" \\\n  -H \"X-Hub-Signature-256: sha256=dummy\" \\\n  --data-binary @test-payloads/ping.json\n```\n\n**Option B – Compute the correct signature locally** (no skip needed):\n\nGitHub computes the signature as an HMAC-SHA256 over the raw request body using the webhook secret as the key.\n\n```bash\nSECRET=\"your-webhook-secret\"\nPAYLOAD_FILE=\"test-payloads/ping.json\"\n\nHASH=$(SECRET=\"$SECRET\" PAYLOAD_FILE=\"$PAYLOAD_FILE\" bun -e \"\n  const { createHmac } = require('crypto');\n  const { readFileSync } = require('fs');\n  process.stdout.write(\n    createHmac('sha256', process.env.SECRET)\n      .update(readFileSync(process.env.PAYLOAD_FILE))\n      .digest('hex')\n  );\n\")\nSIG=\"sha256=$HASH\"\n\ncurl -X POST \"http://localhost:8787?chat_id=YOUR_CHAT_ID\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-GitHub-Event: ping\" \\\n  -H \"X-Hub-Signature-256: $SIG\" \\\n  --data-binary @\"$PAYLOAD_FILE\"\n```\n\nAlternatively, use [Hookdeck CLI](https://hookdeck.com/docs/cli) or [ngrok](https://ngrok.com/) to tunnel to `localhost:8787` and set the tunnel URL as the webhook URL in GitHub.\n\n```bash\n# ngrok\nngrok http 8787\n\n# Hookdeck\nhookdeck listen 8787 github\n```\n\n## Debugging\n\n### `DANGEROUS_SKIP_GITHUB_WEBHOOK_SECRET_CHECK`\n\nWhen this variable is set to exactly **`true`** or **`1`**, HMAC signature verification is skipped. **Only use this for local development**, never in production.\n\n### View logs\n\n```bash\n# Live logs of the deployed worker\nbunx wrangler tail\n```\n\n---\n\n## Tests\n\n```bash\nbun test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrawl345%2Fgit-telegram-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrawl345%2Fgit-telegram-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrawl345%2Fgit-telegram-webhook/lists"}