设置webhook_设置WebHook

CodeHub给你发送的 POST 请求将包含如下信息:headers:

Content-Length: 2294

Connection: keep-alive

Host: your.host.com

X-Devcloud-Event: Push Hook

Content-Type: application/json

X-Devcloud-Token: xxxxxxx (如果配置了的话)

body:(推送的具体信息)

{

"object_kind": "push",

"event_name": "push", //事件类型,此例中为推送事件

"before": "0101010101010101010101010101010101010101", //before、after分别记录了此次动作前后的commitID

"after": "0123456789012345678901234567890123456789",

"ref": "refs/heads/master", //触发的分支

"checkout_sha": "0123456789012345678901234567890123456789", //触发事件时被检出的版本

"message": "",

"user_id": 1234, //以下为操作者的信息

"user_name": "example_user",

"user_username": "example_user",

"user_email": "example@huawei.com",

"user_avatar": null,

"project_id": 123456, //以下为触发事件的项目的信息

"project": {

"id": 123456,

"name": "ExampleRepository",

"description": "This is an example repository",

"web_url": "https://codehub.devcloud.huaweicloud.com/ExampleNamespace/ExampleRepository",

"avatar_url": null,

"git_ssh_url": "git@codehub.devcloud.huaweicloud.com:ExampleNamespace/ExampleRepository.git",

"git_http_url": "https://codehub.devcloud.huaweicloud.com/ExampleNamespace/ExampleRepository.git",

"namespace": "ExampleNamespace",

"visibility_level": 0,

"path_with_namespace": "ExampleNamespace/ExampleRepository",

"default_branch": "master",

"ci_config_path": null,

"homepage": "https://codehub.devcloud.huaweicloud.com/ExampleNamespace/ExampleRepository",

"url": "git@codehub.devcloud.huaweicloud.com:ExampleNamespace/ExampleRepository.git",

"ssh_url": "git@codehub.devcloud.huaweicloud.com:ExampleNamespace/ExampleRepository.git",

"http_url": "https://codehub.devcloud.huaweicloud.com/ExampleNamespace/ExampleRepository.git"

},

"commits": { //触发事件的提交的信息

"id": "0123456789012345678901234567890123456789",

"message": "This is an example message",

"timestamp": "2019-05-30T08:50:37Z",

"url": "https://codehub.devcloud.huaweicloud.com/ExampleNamespace/ExampleRepository/commit/0123456789012345678901234567890123456789",

"author": {

"name": "example_user",

"email": "example@huawei.com"

}"added": [

"src/main/java/HelloWorld.java"

],

"modified": [],

"removed": []

},

"total_commits_count": 1,

"repository": { //仓库信息

"name": "ExampleRepository",

"url": "git@codehub.devcloud.huaweicloud.com:ExampleNamespace/ExampleRepository.git",

"description": "This is an example repository",

"homepage": "https://codehub.devcloud.huaweicloud.com/ExampleNamespace/ExampleRepository",

"git_http_url": "https://codehub.devcloud.huaweicloud.com/ExampleNamespace/ExampleRepository.git",

"git_ssh_url": "git@codehub.devcloud.huaweicloud.com:ExampleNamespace/ExampleRepository.git",

"visibility_level": 0

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值