Skip to content

Instantly share code, notes, and snippets.

@booyaa
Created September 27, 2016 10:16
Show Gist options
  • Save booyaa/e1948ebb8e82d1c0d495dec572638fff to your computer and use it in GitHub Desktop.
Save booyaa/e1948ebb8e82d1c0d495dec572638fff to your computer and use it in GitHub Desktop.
creating webhooks per repo
# https://developer.github.com/v3/repos/hooks/#create-a-hook
REPO_OWNER=booyaa # could be parameterized
REPO=hello-homu # could be parameterized
curl -v -H "Authorization: token $GH_PAT" \
-H "Content-Type: application/json" \
-X POST https://api.github.com/repos/$REPO_OWNER/$REPO/hooks \
--data-binary "@payload.json"
{
"name": "web",
"active": true,
"events": [
"push",
"pull_request"
],
"config": {
"url": "http://example.com/webhook",
"content_type": "json"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment