mirror of
https://github.com/bytedream/scripts.git
synced 2025-05-09 20:25:12 +02:00
1.1 KiB
1.1 KiB
Github Webhook
A simple webhook server, which saves a github repository whenever changes were made.
Inspired from this webhook api. The library is pretty useful, but too overloaded for my purposes.
Requires
- gorilla/mux, but if you want to, you can easily cut out the gurilla/mux api and replace it with the api you prefer
Usage
- Create a repository webhook on github.
- Not necessary, but highly recommended: Choose a secret for the webhook.
- Set the value of
gitTree
in main.go to the directory you want to clone the repositories in. - Set the value of
secret
in main.go to the secret, you have chosen in step 2. - Set the callback path in the
main
method in main.go to the path you have chosen when creating the webhook. - Set the port in the
main
method in main.go to the port github is sending the webhook callback.