https://github.com/t-ski/github-webhook-server
Multi-channel webhook server for GitHub events.
https://github.com/t-ski/github-webhook-server
webhook webhook-server
Last synced: 10 months ago
JSON representation
Multi-channel webhook server for GitHub events.
- Host: GitHub
- URL: https://github.com/t-ski/github-webhook-server
- Owner: t-ski
- License: mit
- Created: 2021-06-16T16:22:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-24T23:14:56.000Z (over 1 year ago)
- Last Synced: 2025-01-17T10:44:34.754Z (12 months ago)
- Topics: webhook, webhook-server
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Github Webhook Server
Multi-channel webhook server for [GitHub events](https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks).
## Installation
``` cli
npm i -G t-ski/github-webhook-server
```
> Install **github-webhook-server** globally in order to work with the presented CLI interface. Project local installations must prepend subsequently stated commands with `npx`.
## CLI Usage
``` cli
github-webhook-server [(--start|-S)=./] [(--stop|-T)] [(--monitor|-M)] [--help]
```
| Parameter | Shorthand | Description |
| --------- | --------- | ----------- |
| **--start** | **-S** | *Start a webhook server with the given config JSON* |
| **--stop** | **-T** | *Stop (terminate) a webhook server given the associated port* |
| **--monitor** | **-M** | *Monitor active webhook servers* |
| **--help** | | *Display help text* |
## Setup
A single webhook server is associated with a statically consumed config file (*.json). A config file contains both globally and hook specific information upon which the server instance is created and maintained.
### Globals
Global properties comprise server configurations that affect the spanning context.
``` json
{
"name": "my-hook",
"port": 1234
}
```
| Property | Desciption | Default |
| -------- | ---------- | ------- |
| `name` | *Name to associate with server process* | `null` |
| `port` | *Port to have the server listen on* | `9797` |
### Hook channels
Since the server can handle many hooks at once, each individual hook must be configured to the global `hooks` property array.
``` json
{
"hooks": [
{
"endpoint": "/endpoint",
"secret": "abc...xyz",
"cmd": "git pull && npm update",
"module": "../app/hook.js",
"cwd": "../app/"
}, …
]
}
```
| Property | Desciption | Default |
| -------- | ---------- | ------- |
| `endpoint` | *Hook associated endpoint / request pathname as defined on GitHub* | `null` |
| `secret` | *Hook individual secret as present on GitHub* | `null` |
| `cmd` | *CLI command to perform upon hook activation* | `null` |
| `module` | *JS module to execute / interpret upon hook activation* | `null` |
| `cwd` | *Working directory of the hook bound dynamics* | `./` |
##
© Thassilo Martin Schiepanski