https://github.com/probot/example-netlify-functions
Probot & Netlify Functions example
https://github.com/probot/example-netlify-functions
Last synced: 5 months ago
JSON representation
Probot & Netlify Functions example
- Host: GitHub
- URL: https://github.com/probot/example-netlify-functions
- Owner: probot
- License: isc
- Created: 2021-05-10T18:26:45.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-23T21:01:01.000Z (over 1 year ago)
- Last Synced: 2025-01-23T22:18:19.374Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://probot-example.netlify.app/
- Size: 104 KB
- Stars: 0
- Watchers: 2
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Probot & Netlify Functions example
[](https://app.netlify.com/sites/probot-example/deploys)
This repository is an example of how to deploy the "Hello, World" of probot apps to [Netlify Functions](https://www.netlify.com/products/functions/).
## Local setup
Install dependencies
```
npm install
```
Start the server
```
npm start
```
Follow the instructions to register a new GitHub app.
## Run the netlify function locally
You need to run `npm start` at least once in order to register a new GitHub App for your local testing. It will create a `.env` file with your app's credentials once it's done.
Install the [Netlify Dev CLI](https://www.netlify.com/products/dev/)
```
npm install --global netlify-cli
```
Then start it the root folder of this repository
```
netlify dev
```
In a new terminal app, start [`smee-client`](https://github.com/probot/smee-client/#readme) in order to receive webhook event requests from GitHub
```
npx smee --url [WEBHOOK_PROXY_URL] --target http://127.0.0.1:8888/.netlify/functions/webhooks
```
Replace `WEBHOOK_PROXY_URL` with the value of `WEBHOOK_PROXY_URL` in your `.env` file.
## Deployment
1. Make sure you registered your GitHub App
2. Fork this repository
3. Sign in to your Netlify account, follow instructions at https://app.netlify.com/start
4. In your GitHub App's settings, update the webhook URL to the netlify domain, e.g. `https://my-probot-app.netlify.app/.netlify/functions/webhooks`
5. Add environment variabbles in your Netlify's app's site settings ("Build & deploy" -> "Environment"): `APP_ID`, `PRIVATE_KEY` (replace line breaks with `\n`), `WEBHOOK_SECRET`
6. Trigger a deploy so that the new environment variables take effect.
## License
[ISC](LICENSE)