GithubHelp home page GithubHelp logo

romario333 / gitenforcer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nlf/gitenforcer

0.0 2.0 0.0 14 KB

A github pull request monitoring bot, with middleware support

JavaScript 95.76% HTML 4.24%

gitenforcer's Introduction

GitEnforcer

GitEnforcer is a small bot that you would run on your own server to monitor github pull requests. It comes with a very basic interface to allow you to watch or unwatch your repos. Any time a pull request is created, updated, or commented on, all defined middleware are run. If any middleware fails, the pull request status is set to failed with the reason returned by that failing middleware. If they all pass, the merge button remains green.

Configuration

Configuration is an object containing the following parameters

  • username - the username to authenticate as in github
  • password - the password associated with the username (it only uses basic auth)
  • organization (optional) - if you want to monitor an organization rather than a single user, specify one here
  • baseUrl - the base url (including hostname and port) of gitenforcer, i.e. http://enforcer.yourserver.com:8000
  • pollInterval (optional) - if specified, in seconds, how often to poll github for new repositories to add to the admin page. if not specified, polling will not take place.

Middleware

Middleware are functions defined as

function myMiddleware(pull_request, comments, next) { }

The pull_request object contains all the metadata github returns for a pull request as defined here

Comments is an array of comments on that pull request as defined here

Next is the callback function you should run when your check is complete. If you return no parameter, GitEnforcer will continue execution on the next middleware. If you specify a paramater (as a string) then execution of middleware stops, and that string is set as the reason for failure on the pull request's status.

Usage

var gitenforcer = require('gitenforcer'),
    app = gitenforcer(config);

app.listen(3000);

For basic usage, see example.js

To watch or unwatch a repo, visit the server in your browser.

gitenforcer's People

Contributors

nlf avatar romario333 avatar

Watchers

 avatar  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.