1.1.0 • Published 3 years ago

cloudfunc-gh-hook v1.1.0

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

cloudfunc-gh-hook

Run a Github webhook on Google Cloud functions. This is a wrapper around https://github.com/octokit/webhooks.js)(@octokit/webhook)'s verifyAndReceive method to simplify configuration specific to Google Cloud function.

Installation

yarn add cloudfunc-gh-hook

Usage

import { handler } from "cloudfunc-gh-hook";

export const main = handler({
  "release.released": (event) => console.log(event),
});

Development & Deployment

See https://github.com/benjlevesque/cloudfunc-gh-hook-template for details about development environment and deployment.

API

There is only a root endpoint that accepts a POST HTTP request.

Possible responses:

  • 404 for a non POST request
  • 403 for an invalid or missing secret header
  • 422 when missing required headers x-github-delivery, x-github-event and x-hub-signature
1.1.0

3 years ago

1.0.1

3 years ago