Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tibdex/probot-serverless-now
🤖 Probot Wrapper to run GitHub Apps as Lambdas in Zeit's Now 2.0
https://github.com/tibdex/probot-serverless-now
lambda now probot serverless zeit zeit-now
Last synced: 3 months ago
JSON representation
🤖 Probot Wrapper to run GitHub Apps as Lambdas in Zeit's Now 2.0
- Host: GitHub
- URL: https://github.com/tibdex/probot-serverless-now
- Owner: tibdex
- License: mit
- Archived: true
- Created: 2018-11-27T03:17:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-26T14:07:05.000Z (over 4 years ago)
- Last Synced: 2024-09-22T13:02:09.821Z (3 months ago)
- Topics: lambda, now, probot, serverless, zeit, zeit-now
- Language: TypeScript
- Homepage:
- Size: 271 KB
- Stars: 33
- Watchers: 2
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Goal
`probot-serverless-now` is a wrapper around [Probot](https://github.com/probot/probot) to run your GitHub Apps as Serverless Functions with [ZEIT Now](https://zeit.co).
**Note**: This package is not maintained anymore as [GitHub Actions](https://github.com/features/actions) and [github-app-token](https://github.com/marketplace/actions/github-app-token) can, most of the time, replace Probot.
# Usage
- `app.js`
```javascript
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`
```javascript
const { toLambda } = require("probot-serverless-now");const applicationFunction = require("../app");
module.exports = toLambda(applicationFunction);
```- `now.json`
```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
- [x] [Logging](https://probot.github.io/docs/logging/)
- [x] [Sentry](https://probot.github.io/docs/configuration/) integration
- [x] 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](https://zeit.co/docs/v2/deployments/concepts/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](https://yarnpkg.com/lang/en/docs/workspaces/) or [Lerna](https://lerna.js.org/) for instance.