freerider7777 / gitbucket2tgbot

Send gitbucket webhooks to telegram bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gitbucket2tgbot

Send gitbucket webhooks to telegram bot in Node.js (using Express).

The systems is the following: Event in Gitbucket/TeamCity (push/pull request etc) -> webhook (POST to this service) -> send the formatted message to telegram group (simple POST)

This is a beginning of a service to send events from Gitbucket (and github webhooks probably too) to telegram bot https://github.com/gitbucket/gitbucket/wiki/API-WebHook

So we can receive events in telegram group to which all your team is subscribed:


It also receives webhooks from TeamCity:


Usage:
npm i

replace with your bot token (or use env), you can get one from BotFather (https://core.telegram.org/bots/tutorial):
const BOT_TOKEN = 'Your BOT TOKEN';

replace with your chat id (a group for a bot to send to):
const CHAT_ID = -1;

run the service:
node server.js (or start_webhook_bot.cmd for simple start on windows)

It listens on port 2020 by default

You need to setup webhooks to /webHook in gitbucket to send to this service like so:


And also in TeamCity (optional) to /tcWebHook and discord format:


Notice. It doesn't send messages at night time :) You can adjust it in checkDayTime function.

About

Send gitbucket webhooks to telegram bot


Languages

Language:JavaScript 98.3%Language:Batchfile 1.7%