https://github.com/rumkin/anyhook
Emit console scripts on webhook request
https://github.com/rumkin/anyhook
Last synced: about 1 year ago
JSON representation
Emit console scripts on webhook request
- Host: GitHub
- URL: https://github.com/rumkin/anyhook
- Owner: rumkin
- License: other
- Created: 2016-07-08T14:38:28.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-27T20:08:14.000Z (over 9 years ago)
- Last Synced: 2025-03-01T06:35:01.892Z (over 1 year ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Anyhook
Capture web hooks from github and bitbucket and call associated bash scripts.
## Installation
Install via npm:
```bash
npm i anyhook -g
```
## Usage
Create `webhook.json`:
```json
{
"repoName": {
"token": "8ecc7e51-b2d6-4f75-ad32-2971ca04a76f",
"enabled": true,
"branch": "master",
"exec": [
"echo \"Updated: $WEBHOOK_REPO\" > /var/log/repo-name.log",
{
"cmd": "bash",
"args": ["-c", "echo \"Updated: $WEBHOOK_REPO\""],
"stdio": "/var/log/repo-name.log",
}
]
}
}
```
**NOTE** Both commands in example are equivalent.
Then run anyhook app:
```bash
anyhook --port=8080
```
Now it will listen `0.0.0.0:8080` address. Webhooks URL is
`/api/webhook/:repoName`.
## License
MIT.