How do you create a webhook from curl or github cli?
This doc. does not help a lot: https://docs.github.com/en/rest/reference/repos#create-a-repository-webhook--code-samples
Tried this:
curl -u <user>:<token>\
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/<org>/<repo>/hooks \
-d '{"name":"name"}'
Leaves me with questions:
- What is
-d '{"name":"name"}' - How do you add a config
Errors:
{
"message": "Validation Failed",
"errors": [
{
"resource": "Hook",
"code": "custom",
"message": "Config must contain URL for webhooks"
}
],
"documentation_url": "https://docs.github.com/rest/reference/repos#create-a-repository-webhook"
}