Neighbor's Preppy Maltese

    check-pull-request

    0.0.1 • Public • Published

    check-pull-request

    Using AWS Lambda you can make super-simple Pull Request Checks:

    Usage

    check(opts, handler);

    opts

    const opts = {
      appName: 'My App',
      appId: // from GitHub,
      secret: // set up with GitHub,
      bucket: // provision an S3 bucket to store a certificate for authenticating,
      key: // and specify the key
    };

    handler

    const handler = async pr =>
    /*
    pr is an object that has properties such as repo, owner, headSha, baseRef
     
    and helper functions:
     
    getBody() - gets the body of the Pull Request
    getHeadContent(path) -- gets the file at HEAD
    getBaseContent(path) -- gets the file at the base
    */

    handler can return false to avoid providing a Status Check.

    Example

    'use strict';
     
    const check = require('check-pull-request');
     
    module.exports.handler = check(opts, async pr => {
      return {
        conclusion: 'neutral',
        title: 'No opinion',
        summary: 'I did not check anything because I am an example!',
      };
    });

    Keywords

    none

    Install

    npm i check-pull-request

    DownloadsWeekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    7.61 kB

    Total Files

    7

    Last publish

    Collaborators

    • dougmoscrop