跳到主要内容

Tag Push Event

Tag Push事件参数说明

请求头

参数名称类型参数说明
User-Agentstring
Content-Typestring
X-GitCode-Eventstring事件类型,Tag Push Hook代表标签推送事件
X-GitCode-Deliverystring请求唯一id

请求参数

参数名称参数类型参数说明
object_kindstring事件类型,此处为 "tag_push"
event_namestring事件名称,此处为 "tag_push"
beforestring推送前的提交SHA值(新建标签时为全0)
afterstring推送后的提交SHA值
refstringGit引用路径,例如 "refs/tags/test2"
base_refstring基础分支名称
checkout_shastring检出的提交SHA值
messagestring消息内容
user_idinteger触发推送事件的用户ID
user_namestring用户名称
user_usernamestring用户登录名
user_emailstring用户邮箱
user_avatarstring用户头像URL
project_idinteger项目ID
project.idinteger项目ID
project.namestring项目名称
project.web_urlstring项目Web访问地址
project.avatar_urlstring项目头像URL
project.git_ssh_urlstring项目SSH克隆地址
project.git_http_urlstring项目HTTP克隆地址
project.namespacestring项目命名空间
project.visibility_levelinteger项目可见性级别(0: 私有, 1:公开)
project.path_with_namespacestring带命名空间的项目路径
project.default_branchstring默认分支
project.homepagestring项目主页
project.urlstring项目Git仓库URL
project.ssh_urlstring项目SSH克隆URL
project.http_urlstring项目HTTP克隆URL
commitsarray提交信息数组
commits[].idstring提交的SHA值
commits[].messagestring提交信息
commits[].timestampstring提交时间戳
commits[].urlstring提交详情页面URL
commits[].author.namestring提交作者名称
commits[].author.emailstring提交作者邮箱
total_commits_countinteger提交总数
push_optionsarray推送选项数组
repository.namestring仓库名称
repository.urlstring仓库Git URL
repository.homepagestring仓库主页
repository.git_http_urlstring仓库HTTP克隆地址
repository.git_ssh_urlstring仓库SSH克隆地址
repository.visibility_levelinteger仓库可见性级别(0: 私有, 1:公开)
manual_buildboolean
uuidstring事件唯一标识符

请求参数示例

{
"object_kind": "tag_push",
"event_name": "tag_push",
"before": "0000000000000000000000000000000000000000",
"after": "d55f9d34de9537bddaae80d6dcfe07aaa15e957a",
"ref": "refs/tags/test2",
"base_ref": "main",
"checkout_sha": "d55f9d34de9537bddaae80d6dcfe07aaa15e957a",
"message": "",
"user_id": 173794,
"user_name": "xiaogang_o",
"user_username": "xiaogang_o",
"user_email": "",
"user_avatar": "https://cdn-img.gitcode.com/ee/ca/756863eec250a6a067148d4d4fe71d28c3b9716a6f79c03a9f460543fa3dc838.jpg?time=1711433667506",
"project_id": 1848674,
"project": {
"id": 1848674,
"name": "test",
"web_url": "https://gitcode.com/xiaogang_o/test",
"avatar_url": "https://cdn-img.gitcode.com/ee/ca/756863eec250a6a067148d4d4fe71d28c3b9716a6f79c03a9f460543fa3dc838.jpg?time=1711433667506",
"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",
"homepage": "https://gitcode.com/xiaogang_o/test",
"url": "git@gitcode.com:xiaogang_o/test.git",
"ssh_url": "git@gitcode.com:xiaogang_o/test.git",
"http_url": "https://gitcode.com/xiaogang_o/test.git"
},
"commits": [
{
"id": "d55f9d34de9537bddaae80d6dcfe07aaa15e957a",
"message": "update: 更新文件 你好.txtSigned-off-by: xiaogang_o <xiaogang@csdn.net>",
"timestamp": "2025-05-07T05:58:22Z",
"url": "https://gitcode.com/xiaogang_o/test/commits/detail/d55f9d34de9537bddaae80d6dcfe07aaa15e957a",
"author": {
"name": "xiaogang_o",
"email": "xiaogang@csdn.net"
}
}
],
"total_commits_count": 1,
"push_options": [],
"repository": {
"name": "test",
"url": "git@gitcode.com:xiaogang_o/test.git",
"homepage": "https://gitcode.com/xiaogang_o/test",
"git_http_url": "https://gitcode.com/xiaogang_o/test.git",
"git_ssh_url": "git@gitcode.com:xiaogang_o/test.git",
"visibility_level": 0
},
"manual_build": false,
"uuid": "124d0745-22c5-4105-8dd8-c80f45b9cf8b"
}