我想使用GitHub webhooks,但是GitHub正在从我给它的网址中删除端口号,所以它们不起作用。这似乎是一件新事物,因为它曾经起作用。有没有办法告诉GitHub保留端口号?
注意:我正在通过API
创建webhook答案 0 :(得分:1)
我认为端口号不会被剥夺。
POST https://api.github.com/repos/my-name/my-repo/hooks
身体:
{
"name": "web",
"active": true,
"events": [
"push",
"pull_request"
],
"config": {
"url": "http://example.com:345/webhook",
"content_type": "json"
}
}
创建WebHook:
BTW,在这个页面上GitHub呈现没有端口号的URL。
但是如果点击“编辑”按钮:
显示端口号。
如果你执行
,你会得到同样的结果GET https://api.github.com/repos/my-name/my-repo/hooks
{
"url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574",
"test_url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574/test",
"ping_url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574/pings",
"id": 7221574,
"name": "web",
"active": true,
"events": [
"push",
"pull_request"
],
"config": {
"url": "http://example.com:345/webhook",
"content_type": "json"
},
"last_response": {
"code": 504,
"status": "timeout",
"message": "Service Timeout",
},
"updated_at": "2016-02-08T09:37:45Z",
"created_at": "2016-02-08T09:37:45Z"
}
}
确保: