如何从 curl 或 github cli 创建 webhook?
这个文档。没有多大帮助: https ://docs.github.com/en/rest/reference/repos#create-a-repository-webhook--code-samples
试过这个:
curl -u <user>:<token>\
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/<org>/<repo>/hooks \
-d '{"name":"name"}'
给我留下了一些问题:
- 什么是
-d '{"name":"name"}'
- 怎么添加配置
错误:
{
"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"
}