https://github.com/songquanpeng/webhook
Execute predefined commands on your server when receiving a specific HTTP GET request.
https://github.com/songquanpeng/webhook
webhook webhook-server webhooks-catcher
Last synced: 20 days ago
JSON representation
Execute predefined commands on your server when receiving a specific HTTP GET request.
- Host: GitHub
- URL: https://github.com/songquanpeng/webhook
- Owner: songquanpeng
- Created: 2020-11-22T06:42:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-02T05:14:25.000Z (almost 2 years ago)
- Last Synced: 2025-04-15T00:05:57.116Z (20 days ago)
- Topics: webhook, webhook-server, webhooks-catcher
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Webhook Service
[](https://gitpod.io/#https://github.com/songquanpeng/webhook-service)
## Build
```
make
```## Usage
### Cli
You can use `./cli command` to run specified command.Or you can use `./cli` to get into the cli's shell and execute commands.
#### Commands
1. n / new: create new webhook.
2. d / delete id: delete specified webhook.
3. m / modify id: modify existed webhook.
4. e / execute id: execute specified webhook.
5. l / list: list all webhooks.
6. s / search keyword: search webhooks by a keyword in name or description.
7. p / print id: print detail information of specified webhooks.
8. h / help: print help information.
9. q / quit: quit cli shell.### Server
Start server by run `./server` or `./server port`, the default port is 8080.Start server with pm2: `pm2 start ./server --name webhook-service -- 8080`.
## User case: update blog when there is a new github commit
1. Firstly you should create a shell script that runs `git pull` and blog website update command.
2. Then you run the `cli` to create a new webhook, which executor is the path of the above script.
3. Copy the url from the output and register the webhook in your Github repo's webhook page.
4. Then when you push a new commit to this repo, Github will send a post request to the server which will execute the specified script.