Skip to content

Instantly share code, notes, and snippets.

@0sc
Created December 30, 2017 01:44
Show Gist options
  • Save 0sc/1c2ffd7dd94fca0a63e72002170d07cd to your computer and use it in GitHub Desktop.
Save 0sc/1c2ffd7dd94fca0a63e72002170d07cd to your computer and use it in GitHub Desktop.
Sample sicuro code snippet for creating a webhook on a repo
...
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