Commit Event
Description of Commit event parameters
Request Headers
Parameter Name | Type | Description |
---|---|---|
User-Agent | string | |
Content-Type | string | |
X-GitCode-Event | string | Event type, Push Hook represents the push event |
X-GitCode-Delivery | string | Unique request ID |
Request Parameters
Parameter Name | Parameter Type | Description |
---|---|---|
object_kind | string | Event type, here "push" indicates a push event |
event_name | string | Event name, same as object_kind, indicating a push event |
before | string | The commit SHA value before the push |
after | string | The commit SHA value after the push |
ref | string | Git reference path, e.g., "refs/heads/main" for the main branch |
checkout_sha | string | The checked-out commit SHA value |
message | string | Message content |
user_id | integer | User ID triggering the push event |
user_name | string | User's display name |
user_username | string | User's username |
user_email | string | User's email address |
user_avatar | string | User's avatar URL address |
project_id | integer | Project's unique identifier |
project.id | integer | Project ID |
project.name | string | Project name |
project.description | string | Project description |
project.web_url | string | Project's web access URL |
project.avatar_url | string | Project's avatar URL address |
project.git_ssh_url | string | Project's SSH clone URL |
project.git_http_url | string | Project's HTTP clone URL |
project.namespace | string | Project's namespace |
project.visibility_level | integer | Project visibility level (0: private, 1: public) |
project.path_with_namespace | string | Project path with namespace |
project.default_branch | string | Project's default branch |
project.homepage | string | Project homepage URL |
project.url | string | Project Git repository URL |
project.ssh_url | string | Project SSH clone URL |
project.http_url | string | Project HTTP clone URL |
commits[].id | string | Commit SHA value |
commits[].message | string | Commit message |
commits[].timestamp | string | Commit timestamp |
commits[].url | string | URL for the commit details page |
commits[].author.name | string | Commit author's name |
commits[].author.email | string | Commit author's email |
commits[].added | array | List of files added in this commit |
commits[].removed | array | List of files removed in this commit |
commits[].modified | array | List of files modified in this commit |
total_commits_count | integer | Total number of commits pushed |
push_options | array | Array of push options |
repository.name | string | Repository name |
repository.url | string | Repository Git URL |
repository.description | string | Repository description |
repository.homepage | string | Repository homepage URL |
repository.git_http_url | string | Repository HTTP clone address |
repository.git_ssh_url | string | Repository SSH clone address |
repository.visibility_level | integer | Repository visibility level (0: private, 1: public) |
git_branch | string | Target branch name for the push |
git_commit_no | string | SHA value of the latest commit |
manual_build | boolean | |
uuid | string | Unique identifier for this push event |
Example of Request Parameters
{
"object_kind": "push",
"event_name": "push",
"before": "1d27e394fbd0491f139dd2e577aa3e214a2fc18e",
"after": "d55f9d34de9537bddaae80d6dcfe07aaa15e957a",
"ref": "refs/heads/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"
},
"added": [],
"removed": [],
"modified": [
"你好.txt"
]
}
],
"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
},
"git_branch": "main",
"git_commit_no": "d55f9d34de9537bddaae80d6dcfe07aaa15e957a",
"manual_build": false,
"uuid": "d6869f2d-56a3-4b77-90ee-f4957e582df6"
}