Git Product home page Git Product logo

probot-serverless-now's Introduction

Goal

probot-serverless-now is a wrapper around Probot to run your GitHub Apps as Serverless Functions with ZEIT Now.

Note: This package is not maintained anymore as GitHub Actions and github-app-token can, most of the time, replace Probot.

Usage

  • app.js

    module.exports = app => {
      app.on("issues.opened", async context => {
        // A new issue was opened, what should we do with it?
        context.log(context.payload);
      });
    };
  • api/index.js

    const { toLambda } = require("probot-serverless-now");
    
    const applicationFunction = require("../app");
    
    module.exports = toLambda(applicationFunction);
  • now.json

    {
      "version": 2,
      "env": {
        "APP_ID": "@my-app-id",
        "PRIVATE_KEY": "@my-app-base64-encoded-private-key",
        "WEBHOOK_SECRET": "@my-app-webhook-secret"
      }
    }

Supported Probot Features

  • Logging
  • Sentry integration
  • Webhook signature verification
  • Loading the private key from the filesystem. The PRIVATE_KEY environment variable should be used instead (possibly base64 encoded).
  • Custom routing. The only routes are:
    • GET /: typical Probot landing page
    • POST /: webhook handler
  • Multiple applications running under the same Probot instance. Instead, you should create multiple Now Lambdas. Each lambda should have its own now.json file since they won't share the same APP_ID, PRIVATE_KEY, and WEBHOOK_SECRET environment variables. To do that, you could either use multiple repositories or a mono-repo with Yarn workspaces or Lerna for instance.

probot-serverless-now's People

Contributors

styfle avatar tibdex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

probot-serverless-now's Issues

Does this still function?

Hi -- I've been trying a couple days to get this working, but all I ever get is a 404 at the /api endpoint.

Additionally I cloned the repo down but the tests do not pass. Has something broken, or has there been a change in Now that might require changes here?

Thanks!

Invalid links to probot libs

It looks like a lot of files are referencing invalid files from probot library. For example: https://github.com/tibdex/probot-serverless-now/blob/master/src/utils.ts#L2

import { findPrivateKey } from "probot/lib/private-key";

But this file was moved to the src/ folder in May 2018: https://github.com/probot/probot/pull/372/files#diff-642674d9d48b666393c2d65de4cacc8b

I'm not sure how exactly but it worked ok with probot version 7. After migrating to the version 8 and 9 I'm having issues.

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.