Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benjlevesque/cloudfunc-gh-hook
https://github.com/benjlevesque/cloudfunc-gh-hook
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/benjlevesque/cloudfunc-gh-hook
- Owner: benjlevesque
- License: mit
- Created: 2021-02-06T11:15:40.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-02-06T16:26:32.000Z (over 3 years ago)
- Last Synced: 2024-09-12T01:10:35.761Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 159 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cloudfunc-gh-hook
Run a Github webhook on Google Cloud functions. This is a wrapper around [@octokit/webhook](https://github.com/octokit/webhooks.js)'s `verifyAndReceive` method to simplify configuration specific to Google Cloud function.
## Installation
```bash
yarn add cloudfunc-gh-hook
```## Usage
```typescript
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`