https://github.com/stigok/githubhook
Execute a command on GitHub webhook events
https://github.com/stigok/githubhook
github nodejs webhooks
Last synced: 12 months ago
JSON representation
Execute a command on GitHub webhook events
- Host: GitHub
- URL: https://github.com/stigok/githubhook
- Owner: stigok
- License: cc0-1.0
- Created: 2017-01-26T08:24:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-16T08:26:52.000Z (about 2 years ago)
- Last Synced: 2024-04-16T11:29:11.485Z (about 2 years ago)
- Topics: github, nodejs, webhooks
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Install
- Clone repo
- Run `npm install --global` in project folder to install the `githubhook` binary
## Usage
Set required environment variables. **Defaults are not provided!**
- `PORT` What port to listen on
- `SECRET` Secret key used for creating HMAC digest of the payload
- `CMD` Command to run whenever a request with a valid payload is received
Start the server with `githubhook`
### Example
In a setup where a Node.js app folder is watched by `nodemon`, it runs the
`--exec` process and restarts it whenever a file with a specific extension is
touched.
nodemon --watch "./" --ext "refresh" --delay "1" --exec "git pull && npm start"
The `githubhook` executes `touch trigger.refresh` whenever a valid payload is
sent to the HTTP server.
PORT=3000 SECRET=sesame CMD="touch trigger.refresh" githubhook
## References
- https://developer.github.com/webhooks/