Created
December 30, 2017 01:44
-
-
Save 0sc/1c2ffd7dd94fca0a63e72002170d07cd to your computer and use it in GitHub Desktop.
Sample sicuro code snippet for creating a webhook on a repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
client := github.NewClient(nil) | |
hook := github.Hook{ | |
Name: github.String("web"), | |
Active: &active, | |
Events: []string{"push", "pull_request"}, | |
Config: map[string]interface{}{ | |
"content_type": "json", | |
"url": "http://localhost/our/webhook/callback/url", | |
"secret": "some-security-token", | |
}, | |
} | |
client.Repositories.CreateHook(ctx, "username or github id", "repository name", &hook) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment