Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

A bot to organize GitLab Webhooks into Discord Threads🧵

License

Notifications You must be signed in to change notification settings

LEDBrain/gitlab-webhook-threads

Repository files navigation

gitlab-webhook-threads

ToDo: add a description of what this is.

Configuration

Requirements

  • Node.js v16.6.0 or higher

Building the bot

  1. Download or clone the repo (or download the latest Source Code zip from the releases page and unpack it)
  2. Edit .env.example and add the required configurations (see configurating)
  3. Rename .env.example to .env
  4. Open a terminal and run npm install
  5. Then run npm run build

There will maybe be a Dockerfile in the future

Config

  • DISCORD_TOKEN - A token for a bot from https://discord.com/developers/applications
  • CHANNEL_ID - A channel id from the channel where to create the threads in
  • GITLAB_ORG_NAME - The name of your GitLab Org (without any / or spaces; can also be a personal username)
  • PORT optional; default is 4000 - The port to run the bot on

Starting the bot

We sugest using pm2 to start the bot.

  1. Install pm2 globally: npm install -g pm2
  2. Go to the bot directory.
  3. Run pm2 start ecosystem.config.js.

To stop the bot, simply go to the bot directory and run pm2 stop ecosystem.config.js.

Configuring GitLab

  1. Go to https://gitlab.com/
  2. Go to your Group (or Project) -> Settings -> Integrations
  3. Find Discord Notifications and click on it
  4. Make sure Enable integration is checked
  5. Check every trigger you want to receive notifications for
  6. Fill out Webhook with http://<your_domain>:<your_port>/incoming (refer to the configuration for the port)
  7. Click Save changes