Git Product home page Git Product logo

pr_bot's Introduction

PR Bot

A Bot that assigns reviewers to github PR's.

When you add a specific label to a pull request, this bot will assign reviewers. It picks one random reviewer per review "group". PR Bot will not re-assign already assigned PR's. If you want to reassign a PR, first remove the current assignees.

This bot will need the username and password of a github user with access to the repo OR a github access token.

Setup

  1. Run this Sinatra app with the following env vars
  • GITLAB_TOKEN: an access token for a user with repo access scope.
  • GITLAB_ENDPOINT: the URL for Gitlab's API
  • PR_LABEL: the label's text string to trigger the bot.
  • REVIEWER_POOL: a list of github username lists.
  1. Add a webhook to your github repository
  • If this bot is running at prbot.example.com, set the webhook to https://prbot.example.com/.
  • Set the Content type to application/json.
  • Don't set a secret.
  • Choose "Let me select individual events" and check only "Pull request".

Usage

Make sure you're running ruby 2.1+, and install the gem dependencies:

bundle install

You can run the Sinatra app like so, (or use a .env file).

GITHUB_TOKEN=5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 PR_LABEL=for-review REVIEWER_POOL=["user1", "user2", "user3"] ruby app.rb

Docker

Alternatively you can run this with docker.

docker run -p 4567:4567 -e "PR_LABEL=for-review" -e "GITHUB_TOKEN=5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" -e 'REVIEWER_POOL=["user1", "user2", "user3"]' andruby/pr_bot

Build and run

docker build -t pr_bot .
docker run -p 4567:4567 -e "PR_LABEL=for-review" -e "GITHUB_TOKEN=5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" -e 'REVIEWER_POOL=["user1", "user2", "user3"]' pr_bot

pr_bot's People

Contributors

andruby avatar dependabot[bot] avatar gregmolnar avatar norydev avatar pawelniewie avatar zhann avatar

Watchers

 avatar

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.