/github-bot-prmanager

⚙️ A PR bot manager (labels...)

Primary LanguageJavaScriptMIT LicenseMIT

github-bot-prmanager

Why ?

This bot allows to manage more efficiently your github pull requests by setting a set of automatic behaviors.

These behaviors are defined thanks to a plugin system.

Basically, github-bot-prmanager listens to github bot events and responds by a set of actions that can be defined via those plugins.

Installation

Manual:

  • Clone the repository: git clone https://github.com/adbayb/github-bot-prmanager.git
  • cd github-bot-prmanager
  • Creates a .env file by following the .env.example template to add your github user token (which will act as a user bot)/configure the bot. Please, note: repo token scope is the minimal rights requirements to give to the user bot.
  • npm install
  • npm start
  • You're all done, the bot is now lauched and listens to port 3000.
  • You can now enable your bot into your github repository by adding your bot server as a github webhook (@see Github documentation: Setting up a Webhook).

Docker:

  • Clone the repository: git clone https://github.com/adbayb/github-bot-prmanager.git
  • cd github-bot-prmanager
  • Creates a .env file by following the .env.example template to add your github user token (which will act as a user bot)/configure the bot. Please, note: repo token scope is the minimal rights requirements to give to the user bot.
  • docker build -t github/bot .
  • docker run -p 3000:3000 github/bot
  • You're all done, the bot is now lauched and listens to port 3000.
  • You can now enable your bot into your github repository by adding your bot server as a github webhook (@see Github documentation: Setting up a Webhook).

List of plugins

Related to label management:

  • Approval: For each review, it checks if the targetted lowest required approval is reached. If yes, it adds the label LGTM to the PR.
  • Title: For each created pull request, it checks the title format and extracts the scope from it. Basically, a pull request must follow the angular commit message convention (Angular's commit convention: <type>(<scope>): <subject>) to be trated by this plugin. It will extract the scope and add associated label to the pull request (creates one if not).