mirror of
https://github.com/bytedream/scripts.git
synced 2025-05-09 20:25:12 +02:00
Added extended explanation
This commit is contained in:
parent
a0a5094560
commit
b978c7c77e
@ -15,5 +15,6 @@ The library is pretty useful, but too overloaded for my purposes.
|
|||||||
2. Not necessary, but highly recommended: Choose a [secret](https://docs.github.com/en/developers/webhooks-and-events/securing-your-webhooks) for the webhook.
|
2. Not necessary, but highly recommended: Choose a [secret](https://docs.github.com/en/developers/webhooks-and-events/securing-your-webhooks) for the webhook.
|
||||||
3. Set the value of `gitTree` in [main.go](main.go#L19) to the directory you want to clone the repositories in.
|
3. Set the value of `gitTree` in [main.go](main.go#L19) to the directory you want to clone the repositories in.
|
||||||
4. Set the value of `secret` in [main.go](main.go#L20) to the secret, you have chosen in step 2.
|
4. Set the value of `secret` in [main.go](main.go#L20) to the secret, you have chosen in step 2.
|
||||||
5. Set the callback path in the `main` method in [main.go](main.go#L406) to the path you have chosen when creating the webhook.
|
5. Replace the ids in `gw.AddPushEvent` and `gw.AddRepositoryEvent` in [main.go](main.go#L401) with the id of the repository you created the webhook for.
|
||||||
6. Set the port in the `main` method in [main.go](main.go#L408) to the port github is sending the webhook callback.
|
6. Set the callback path in the `main` method in [main.go](main.go#L405) to the path you have chosen when creating the webhook.
|
||||||
|
7. Set the port in the `main` method in [main.go](main.go#L407) to the port github is sending the webhook callback.
|
||||||
|
@ -400,7 +400,6 @@ func main() {
|
|||||||
gw := &GithubWebhook{pushEvents: make(map[int64][]OnPayload), repositoryEvents: make(map[int64][]OnPayload), repoNames: make(map[int64]string)}
|
gw := &GithubWebhook{pushEvents: make(map[int64][]OnPayload), repositoryEvents: make(map[int64][]OnPayload), repoNames: make(map[int64]string)}
|
||||||
gw.AddPushEvent(364735060, updateLocal)
|
gw.AddPushEvent(364735060, updateLocal)
|
||||||
gw.AddRepositoryEvent(364735060, renameLocal)
|
gw.AddRepositoryEvent(364735060, renameLocal)
|
||||||
|
|
||||||
// NOTE: To find out the id of a repository, go to the repo page, open the browser / developer console and execute `document.head.querySelector("meta[name=octolytics-dimension-repository_id]").content`
|
// NOTE: To find out the id of a repository, go to the repo page, open the browser / developer console and execute `document.head.querySelector("meta[name=octolytics-dimension-repository_id]").content`
|
||||||
|
|
||||||
r.HandleFunc("/github_webhook", gw.OnWebhook).Methods("POST")
|
r.HandleFunc("/github_webhook", gw.OnWebhook).Methods("POST")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user