Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/greedbell/github-webhooks
[Developing] Node.js service for processing GitHub Webhooks
https://github.com/greedbell/github-webhooks
Last synced: 21 days ago
JSON representation
[Developing] Node.js service for processing GitHub Webhooks
- Host: GitHub
- URL: https://github.com/greedbell/github-webhooks
- Owner: greedbell
- License: mit
- Created: 2017-07-18T03:40:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-21T08:27:05.000Z (over 7 years ago)
- Last Synced: 2024-10-16T08:09:52.641Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-webhooks
Node.js service for processing GitHub Webhooks
## Usage
### Dependencies
* node >= 8.0
* npm >= 5.0### Install
```sh
git clone https://github.com/greedbell/github-webhooks.git
npm install --production
```### Config
copy `config.example.json` to `config.json`, and edit your `config.json` like
```
[
{
"path": "/callback/example/push-github-webhooks-master",
"secret": "webhook-secret",
"event": "push",
"script": "scripts-example/push.sh"
},
{
"path": "/callback/example/issues-github-webhooks",
"secret": "webhook-secret",
"event": "issues",
"script": "scripts-example/other.sh"
}
]
```#### path
path for the webhook
#### secret
secret for request
#### event
reference [Event Types & Payloads](https://developer.github.com/v3/activity/events/types/)
* [issues](https://developer.github.com/v3/activity/events/types/#issuesevent)
* [push](https://developer.github.com/v3/activity/events/types/#pushevent)#### script
script file path to run
### Run
in development
```sh
npm run develop
```in production
```sh
npm run release
```test
```
http://localhost:4201/callback/example/push-github-webhooks-master?secret=webhook-secret&ref=ref&payload={"ref":"refs/heads/master"}
```### Add webhook in GitHub
```
Settings > Webhooks > Add webhook
```* `Payload URL`: /
* `Content type`: `application/x-www-form-urlencoded`
* `Secret`
* select eventsAdd webhook