Pull Request Event
Pull Request合并请求事件参数说明
请求头
参数名称 | 类型 | 参数说明 |
---|---|---|
User-Agent | string | |
Content-Type | string | |
X-GitCode-Event | string | 事件类型,Merge Request Hook代表合并请求事件 |
X-GitCode-Delivery | string | 请求唯一id |
请求参数
参数名称 | 参数类型 | 参数说明 |
---|---|---|
produce_random_id | string | 随机生成的事件ID |
event_type | string | 事件类型,此处为 "merge_request" |
object_kind | string | 对象类型,此处为 "merge_request" |
git_branch | string | Git分支名称 |
git_commit_no | string | 当前提交SHA |
git_target_branch_commit_no | string | 目标分支提交SHA |
manual_build | boolean | |
virtual_merge_build | boolean | |
uuid | string | 事件唯一标识符 |
labels | array | 标签列表 |
issues | array | 关联的issue列表 |
object_attributes.id | integer | 合并请求的ID |
object_attributes.iid | integer | 合并请求在项目中的ID |
object_attributes.title | string | 合并请求标题 |
object_attributes.description | string | 合并请求描述 |
object_attributes.state | string | 合并请求状态(opened: 开启的,merged: 已合并,closed: 关闭的) |
object_attributes.created_at | string | 创建时间 |
object_attributes.updated_at | string | 更新时间 |
object_attributes.action | string | 操作类型(open:开启, update: 更新, merge:合并, close: 关闭) |
object_attributes.work_in_progress | boolean | 是否为进行中的工作 |
object_attributes.merge_status | string | 合并状态(unchecked: 未检查) |
object_attributes.merge_when_pipeline_succeeds | boolean | 是否在流水线成功后自动合并 |
object_attributes.source_branch | string | 源分支名称 |
object_attributes.target_branch | string | 目标分支名称 |
object_attributes.source_project_id | integer | 源项目ID |
object_attributes.target_project_id | integer | 目标项目ID |
object_attributes.author_id | integer | 作者ID |
object_attributes.url | string | 合并请求的Web访问地址 |
object_attributes.need_review | boolean | 是否需要评审 |
object_attributes.need_test | boolean | 是否需要测试 |
object_attributes.conflict | boolean | 是否存在冲突 |
object_attributes.total_time_spent | integer | |
object_attributes.oldrev | string | 旧版本提交号 |
object_attributes.update_reason | string | 更新原因 |
object_attributes.reviewer_list | array | 评审者列表 |
object_attributes.assignee_list | array | 指派人列表 |
object_attributes.last_commit.id | string | 最后一次提交的SHA值 |
object_attributes.last_commit.message | string | 最后一次提交信息 |
object_attributes.last_commit.timestamp | string | 最后一次提交时间戳 |
object_attributes.last_commit.url | string | 最后一次提交详情页面URL |
object_attributes.last_commit.author.name | string | 最后一次提交作者名称 |
object_attributes.last_commit.author.email | string | 最后一次提交作者邮箱 |
object_attributes.target_branch_commit.id | string | 目标分支提交的SHA值 |
object_attributes.target_branch_commit.message | string | 目标分支提交信息 |
object_attributes.target_branch_commit.timestamp | string | 目标分支提交时间戳 |
object_attributes.target_branch_commit.url | string | 目标分支提交详情页面URL |
object_attributes.target_branch_commit.author.name | string | 目标分支提交作者名称 |
object_attributes.target_branch_commit.author.email | string | 目标分支提交作者邮箱 |
object_attributes.merge_params.force_remove_source_branch | boolean | 是否强制删除源分支 |
object_attributes.source.id | integer | 源项目ID |
object_attributes.source.name | string | 源项目名称 |
object_attributes.source.path_with_namespace | string | 源项目带命名空间的路径 |
object_attributes.source.namespace | string | 源项目命名空间 |
object_attributes.source.visibility_level | integer | 源项目可见性级别(0: 私有, 1: 公开) |
object_attributes.source.web_url | string | 源项目Web访问地址 |
object_attributes.source.url | string | 源项目Git仓库URL |
object_attributes.source.http_url | string | 源项目HTTP克隆地址 |
object_attributes.source.ssh_url | string | 源项目SSH克隆地址 |
object_attributes.source.git_http_url | string | 源项目Git HTTP克隆地址 |
object_attributes.source.git_ssh_url | string | 源项目Git SSH克隆地址 |
object_attributes.source.homepage | string | 源项目主页 |
object_attributes.source.avatar_url | string | 源项目头像URL |
object_attributes.source.default_branch | string | 源项目默认分支 |
object_attributes.target | object | 目标项目信息(字段同source) |
object_attributes.author.id | integer | 作者ID |
object_attributes.author.name | string | 作者名称 |
object_attributes.author.username | string | 作者登录名 |
object_attributes.author.email | string | 作者邮箱 |
object_attributes.author.avatar_url | string | 作者头像URL |
changes.merge_params.current | string | 当前合并参数设置 |
changes.patchset_locked.current | boolean | |
changes.merge_when_pipeline_succeeds.current | boolean | 当前流水线成功后自动合并设置 |
changes.iid.current | integer | 当前合并请求IID |
changes.target_branch.current | string | 当前目标分支 |
changes.created_at.current | string | 当前创建时间 |
changes.description.current | string | 当前描述 |
changes.close_issue_when_merge.current | boolean | 合并时是否自动关闭关联的issue |
changes.moderation_result.current | boolean | |
changes.source_project_id.current | integer | 源项目ID |
changes.title.current | string | 当前标题 |
changes.current_patchset_id.current | integer | |
changes.source_branch.current | string | 源分支 |
changes.squash.current | boolean | 当前是否压缩提交 |
changes.updated_at.current | string | 当前更新时间 |
changes.merge_status.current | string | 当前合并状态 |
changes.moderation_time.current | integer | 当前审核时间 |
changes.latest_merge_request_diff_id.current | integer | 当前最新合并请求差异ID |
changes.id.current | integer | 当前合并请求ID |
changes.state.current | string | 当前状态 |
changes.author_id.current | integer | 当前作者ID |
changes.target_project_id.current | integer | 当前目标项目ID |
project | object | 项目信息(字段同object_attributes.source) |
repository | object | 仓库信息(字段同object_attributes.source) |
user | object | 触发事件的用户信息(字段同object_attributes.author) |
请求参数示例
{
"produce_random_id": "f2378f237c994e368e28b40e25210a97",
"event_type": "merge_request",
"object_kind": "merge_request",
"object_attributes": {
"id": 6830111,
"iid": 27,
"title": "update: 更新文件 README.md",
"description": "update: 更新文件 README.md ",
"state": "opened",
"created_at": "2025-05-07T14:43:39+08:00",
"updated_at": "2025-05-07T14:43:40+08:00",
"action": "open",
"work_in_progress": false,
"merge_status": "unchecked",
"merge_when_pipeline_succeeds": false,
"source_branch": "test333",
"target_branch": "main",
"source_project_id": 1848674,
"target_project_id": 1848674,
"author_id": 173794,
"url": "https://gitcode.com/xiaogang_o/test/merge_requests/27",
"need_review": false,
"need_test": false,
"conflict": false,
"total_time_spent": 0,
"merge_params": {
"force_remove_source_branch": false
},
"reviewer_list": [],
"assignee_list": [],
"oldrev": "",
"update_reason": "",
"last_commit": {
"id": "23adec6d9afeb011992b73d700c854ee9388205f",
"message": "update: 更新文件 README.md Signed-off-by: xiaogang <xiaogang@csdn.net>",
"timestamp": "2024-12-06T06:46:48Z",
"url": "https://gitcode.com/xiaogang_o/test/commits/detail/23adec6d9afeb011992b73d700c854ee9388205f",
"author": {
"name": "xiaogang",
"email": "xiaogang@csdn.net"
}
}
},
"changes": {
"merge_params": {
"current": "force_remove_source_branch: false"
},
"patchset_locked": {
"current": false
},
"squash": {
"current": false
},
"close_issue_when_merge": {
"current": false
}
},
"project": {
"id": 1848674,
"name": "test",
"web_url": "https://gitcode.com/xiaogang_o/test",
"git_ssh_url": "git@gitcode.com:xiaogang_o/test.git",
"git_http_url": "https://gitcode.com/xiaogang_o/test.git",
"namespace": "xiaogang_o",
"visibility_level": 0,
"path_with_namespace": "xiaogang_o/test",
"default_branch": "main"
},
"user": {
"id": 173794,
"name": "xiaogang_o",
"username": "xiaogang_o",
"email": "xiaogang@csdn.net",
"avatar_url": "https://cdn-img.gitcode.com/ee/ca/756863eec250a6a067148d4d4fe71d28c3b9716a6f79c03a9f460543fa3dc838.jpg?time=1711433667506"
},
"manual_build": false,
"virtual_merge_build": true,
"git_branch": "merge-requests/27/merge",
"git_commit_no": "7083553a6d16960c879dd601db307b565f2994bb",
"git_target_branch_commit_no": "d55f9d34de9537bddaae80d6dcfe07aaa15e957a",
"uuid": "27_637deb9c-5c95-480f-8530-4d91006c72df"
}