Code Monkey home page Code Monkey logo

mergebot's Introduction

Mergebot

Discord bot for gitlab merge requests.
Checks messages sent into merge request channel assigns reviewers and performs merge requests. Reviewers are picked from online pool of users with the same role as the name of a category in which merge requests channel is.

For example if you have a category named team1 with a channel merge-requests you should have a role team1 with users that should be picked for reviews in that channel.

Environment variables

DISCORD_TOKEN - token for your discord bot
GITLAB_TOKEN - gitlab token to perform merge actions
GITLAB_HOST - gitlab host (ex.: gitlab.local)
APPROVE_COUNT - approvals needed to perform merge action
REVIEWER_COUNT - number of reviewers picked from online pool of users. Users are picked from a role that matches merge channel category
MERGE_REQUEST_CHANNEL - channel name where bot should scan messages for merge requests (ex.: merge-requests)
CATEGORIES - comma separated list of categories. Categories are used to pair merge requests to role. For example if you have category name backend you should also have a role named backend. Users for review will be picked from this role.

Docker

Build docker image

docker build -t mergebot:latest .

Run image

docker run --name mergebot --rm \
    --env DISCORD_TOKEN=<BOT_TOKEN> \
		--env GITLAB_TOKEN=<GITLAB_TOKEN> \
		--env GITLAB_HOST=gitlab.local \
		--env APPROVE_COUNT=2 \
		--env REVIEWER_COUNT=3 \
		--env MERGE_REQUEST_CHANNEL=merge-requests \
		--env CATEGORIES=team1,team2 \
		mergebot

Screenshot!

mergebot's People

Contributors

richardbizik avatar

Watchers

 avatar

Forkers

sunspinx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.