# Git Webhook

# 事件的内容组成

# 推送事件

有新的推送事件到项目时,会触发。如果是 tags 推送,则不会触发。

请求头:

X-Gitlab-Event: Push Hook
X-Event: Push Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "push",
  "operation_kind": "create",
  "action_kind": "client push",
  "before": "b96850262fabfa9a8a9d28fff9040621958379f9",
  "after": "e99db09904cfa385a129305e7660395f161950a",
  "ref": "refs/heads/master",
  "checkout_sha": "e99db09904cfa385a129305e7660395f161950a",
  "start_point": null,
  "user_id": 11323,
  "user_name": "git_user1",
  "user_email": "git_user1@tencent.com",
  "project_id": 165245,
  "repository": {
    "name": "z-test",
    "url": "git@git.tencent.com:test/z-test.git",
    "description": "",
    "homepage": "https://git.tencent.com/test/z-test",
    "git_http_url": "http://git.tencent.com/test/z-test.git",
    "git_ssh_url": "git@git.tencent.com:test/z-test.git",
    "visibility_level": 0
  },
  "commits": [
    {
      "id": "b96850262fabfa9a8a9d28fff9040621958379f9",
      "message": "fix readme",
      "timestamp": "2015-03-13T09:52:25+0000",
      "author_timestamp": "2015-02-21T07:31:01+0000",
      "url": "https://git.tencent.com/test/z-test/commit/b96850262fabfa9a8a9d28fff9040621958379f9",
      "author": {
        "name": "alex",
        "email": "alex@tencent.com"
      },
      "added": [],
      "modified": ["README.md"],
      "removed": []
    },
    {
      "id": "1480a4610ca01dd10cb5bc30d8a1b1ea568c09a1",
      "message": "update readme",
      "timestamp": "2015-03-13T09:51:06+0000",
      "author_timestamp": "2015-02-21T07:31:01+0000",
      "url": "https://git.tencent.com/test/z-test/commit/b96850262fabfa9a8a9d28fff9040621958379f9",
      "author": {
        "name": "Bob",
        "email": "Bob@tencent.com"
      },
      "added": [],
      "modified": ["README.md"],
      "removed": []
    }
  ],
    "diff_files": [
    {
      "new_path": "README.md",
      "old_path": "/dev/null",
      "a_mode": 0,
      "b_mode": 33188,
      "new_file": true,
      "renamed_file": false,
      "deleted_file": false
    }
  ],
  "push_options": {},
  "push_timestamp": "2015-03-21T01:22:00+0000",
  "total_commits_count": 2,
  "truncated_commits": false,
  "total_diff_files_count": 1,
  "truncated_diff_files": false,
  "create_and_update": null
}

返回值说明:

  1. operation_kind 字段
  • create:创建分支、合并普通 MR 的 push
  • delete:删除分支的 push
  • update:文件修改的 push
  • update_nonfastforward:non-fast-forward 提交
  1. action_kind 字段
  • client push:客户端请求(不在工蜂 Web 上操作的都默认是这个)
  • create branch:在工蜂 Web 上创建分支
  • delete branch:在工蜂 Web 上删除分支
  • create tag:在工蜂 Web 上创建 Tag
  • delete tag:在工蜂 Web 上删除 Tag
  • create file:在工蜂 Web 上新建文件
  • modify file:在工蜂 Web 上修改文件
  • delete file:在工蜂 Web 上删除文件
  • replace file:在工蜂 Web 上替换文件
  • create a merge commit:在工蜂 Web 上合并普通 MR
  • squash and merge:在工蜂 Web 上合并 squash merge
  • rebase and merge:在工蜂 Web 上合并 rebase merge
  • cherry-pick:在工蜂 Web 上使用 cherry pick 功能
  • revert:在工蜂 Web 上使用 revert 功能
  1. push_options 字段 表示-o 所携带的参数

  2. total_commits_count 字段 所推送的commit总数

  3. truncated_commits 字段 commits字段中的数据是否有截断,默认最多携带30个commit

  4. total_diff_files_count 字段 所推送的变更文件总数

  5. truncated_diff_files 字段 diff_files字段中的数据是否有截断,默认最多携带1000个文件变更

# Tag 事件

项目中新增或删除 tags 时会触发。

请求头:

X-Gitlab-Event: Tag Push Hook
X-Event: Tag Push Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "tag_push",
  "operation_kind": "create",
  "before": "1480a4610ca01dd10cb5bc3359a1b1ea568c09a1",
  "after": "b96850262fabfa9a1d9d28fff9040621958379f9",
  "ref": "refs/tags/v1.0.2",
  "checkout_sha": "b96850262fabfa9a1d9d28fff9040621958379f9",
  "user_id": 11323,
  "user_name": "git_user1",
  "user_email": "git_user1@tencent.com",
  "project_id": 11452,
  "repository": {
    "name": "tencent",
    "url": "ssh://git@git.tencent.com:z-413/tencent.git",
    "description": "",
    "homepage": "https://git.tencent.com/z-413/tencent",
    "git_http_url": "http://git.tencent.com/z-413/tencent.git",
    "git_ssh_url": "git@git.tencent.com:z-413/tencent.git",
    "visibility_level": 0
  },
  "commits": [
    {
      "id": "458ce39e1a28572597979ca6c7cdc6c338f6bd43",
      "message": "update",
      "timestamp": "2019-03-28T02:14:59+0000",
      "author_timestamp": "2015-02-21T07:31:01+0000",
      "url": "https://git.tencent.com/release-test/xxx-framework/commit/458ce39e1a28572597979ca6c7cdc6c338f6bd43",
      "author": {
        "name": "git_user2",
        "email": "git_user2@tencent.com"
      },
      "added": [],
      "modified": ["README.md"],
      "removed": []
    }
  ],
  "create_from": "master",
  "push_options": {},
  "push_timestamp": "2015-03-21T01:22:00+0000",
  "total_commits_count": 1,
  "message": "Tag message  "
}

返回值说明:

  1. operation_kind 字段

    • create:创建 tag
    • delete:删除 tag
  2. create_from 字段:从哪个分支或者 commit 点创建

  3. message 字段:tag 的附注

# Pre-Receive 事件

当tag或分支有推送到项目时触发,会根据返回结果做拦截。

请求头:

X-Gitlab-Event: Pre Receive Hook
X-Event: Pre Receive Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "push",
  "operation_kind": "create",
  "action_kind": "client push",
  "before": "b96850262fabfa9a8a9d28fff9040621958379f9",
  "after": "e99db09904cfa385a129305e7660395f161950a",
  "ref": "refs/heads/master",
  "checkout_sha": "e99db09904cfa385a129305e7660395f161950a",
  "start_point": null,
  "user_id": 11323,
  "user_name": "git_user1",
  "user_email": "git_user1@tencent.com",
  "project_id": 165245,
  "repository": {
    "name": "z-test",
    "url": "git@git.tencent.com:test/z-test.git",
    "description": "",
    "homepage": "https://git.tencent.com/test/z-test",
    "git_http_url": "http://git.tencent.com/test/z-test.git",
    "git_ssh_url": "git@git.tencent.com:test/z-test.git",
    "visibility_level": 0
  },
  "commits": [
    {
      "id": "b96850262fabfa9a8a9d28fff9040621958379f9",
      "message": "fix readme",
      "timestamp": "2015-03-13T09:52:25+0000",
      "author_timestamp": "2015-02-21T07:31:01+0000",
      "url": "https://git.tencent.com/test/z-test/commit/b96850262fabfa9a8a9d28fff9040621958379f9",
      "author": {
        "name": "alex",
        "email": "alex@tencent.com"
      }
    },
    {
      "id": "1480a4610ca01dd10cb5bc30d8a1b1ea568c09a1",
      "message": "update readme",
      "timestamp": "2015-03-13T09:51:06+0000",
      "author_timestamp": "2015-02-21T07:31:01+0000",
      "url": "https://git.tencent.com/test/z-test/commit/b96850262fabfa9a8a9d28fff9040621958379f9",
      "author": {
        "name": "Bob",
        "email": "Bob@tencent.com"
      }
    }
  ],
  "push_options": {},
  "push_timestamp": "2015-03-21T01:22:00+0000",
  "total_commits_count": 2,
  "truncated_commits": false,
  "total_diff_files_count": 0,
  "truncated_diff_files": false,
  "create_and_update": null
}

# 合并请求事件

新建、更新、合并、关闭或在源分支添加提交合并请求会触发。 请求头:

X-Gitlab-Event: Merge Request Hook
X-Event: Merge Request Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "merge_request",
  "user": {
    "name": "git_user2",
    "username": "git_user2",
    "avatar_url": "https://blog.bobo.com.cn/s/blog_6e572cd60101qls0.html"
  },
  "object_attributes": {
    "id": 23,
    "target_branch": "master",
    "source_branch": "fenzhi01",
    "source_project_id": 2,
    "author_id": 3,
    "assignee_id": 4,
    "title": "agree",
    "created_at": "2018-03-13T09:51:06+0000",
    "updated_at": "2018-03-13T09:51:06+0000",
    "st_commits": null,
    "st_diffs": null,
    "milestone_id": null,
    "state": "opened",
    "merge_status": "unchecked",
    "target_project_id": 14,
    "iid": 1,
    "description": "",
    "source": {
      "name": "rename",
      "ssh_url": "git@git.tencent.com:z-413/rename.git",
      "http_url": "http://git.tencent.com/z-413/rename.git",
      "web_url": "https://git.tencent.com/z-413/rename",
      "visibility_level": 20,
      "namespace": "z-413"
    },
    "target": {
      "name": "rename",
      "ssh_url": "git@git.tencent.com:z-413/rename.git",
      "http_url": "http://git.tencent.com/z-413/rename.git",
      "web_url": "https://git.tencent.com/z-413/rename",
      "visibility_level": 20,
      "namespace": "z-413"
    },
    "last_commit": {
      "id": "1480a4610ca01dd10cb5bc30d83151eab98c09a1",
      "message": "fixed readme",
      "timestamp": "2012-01-03T23:36:29+02:00",
      "url": "https://git.tencent.com/z-413/rename/commits/da1480a4610ca01dd10cb5bc30d83151eab98c09a1",
      "author": {
        "name": "alex",
        "email": "alex@tencent.com"
      }
    },
    "url": "https://git.tencent.com/rename/merge_requests/1",
    "action": "open",
    "extension_action": "open"
  }
}

返回值说明:

  1. action 字段

    • open:新建 MR
    • close:MR 被关闭
    • reopen:MR 重新被打开
    • update:MR 本身信息更新,或源分支有代码 push
    • merge:代码已合并
  2. extension_action 字段

    • open:新建 MR
    • close:MR 被关闭
    • reopen:MR 重新被打开
    • update:MR 本身信息更新
    • push-update:源分支有代码 push
    • merge:代码已合并
    • remove-WIP-update:移除 WIP 标识

# 评审事件

当创建评审或者评审状态改变时会触发。

请求头:

X-Gitlab-Event: Review Hook
X-Event: Review Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "event": "create",
  "author": {
    "name": "git_user2",
    "username": "git_user2",
    "web_url": "https://localhost:8080/u/git_user2",
    "id": 549,
    "avatar_url": "https://localhost:8080/uploads/user/avatar/549",
    "state": "active"
  },
  "reviewers": [
    {
      "reviewer": {
        "name": "git_user1",
        "username": "git_user1",
        "web_url": "https://localhost:3000/u/git_user1",
        "id": 555,
        "avatar_url": "https://localhost:3000/uploads/user/avatar/555",
        "state": "active"
      },
      "id": 18,
      "review_id": 14,
      "user_id": 555,
      "project_id": 56321,
      "type": "invite",
      "state": "change_denied",
      "created_at": "2015-03-13T09:51:06+0000",
      "updated_at": "2015-03-13T09:51:06+0000"
    }
  ],
  "reviewer": {
    "reviewer": {
      "name": "git_user1",
      "username": "git_user1",
      "web_url": "https://localhost:3000/u/git_user1",
      "id": 555,
      "avatar_url": "https://localhost:3000/uploads/user/avatar/555",
      "state": "active"
    },
    "id": 18,
    "review_id": 14,
    "user_id": 555,
    "project_id": 56321,
    "type": "invite",
    "state": "change_denied",
    "created_at": "2015-03-13T09:51:06+0000",
    "updated_at": "2015-03-13T09:51:06+0000"
  },
  "id": 18,
  "project_id": 56321,
  "author_id": 555,
  "reviewable_id": 1298,
  "reviewable_type": "merge_request",
  "commit_id": null,
  "state": "change_denied",
  "restrict_type": "single_approve",
  "push_reset_enabled": true,
  "created_at": "2015-03-13T09:51:06+0000",
  "updated_at": "2015-03-13T09:51:06+0000"
}

# 单文件评审事件

当创建评审或者评审状态改变时会触发。

请求头:

X-Gitlab-Event: File Review Hook
X-Event: File Review Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "event": "create",
  "project_id": 107077,
  "review_id": 6641,
  "reviewer": {
    "user": {
      "name": "git_user1 ",
      "username": "git_user1",
      "web_url": "https://git.tencent.com/u/alexwentong",
      "id": 7581,
      "avatar_url": "thumb_14-77465e9ce7a34ec1814defb2955a4dea.gif",
      "state": "https://git.tencent.com/uploads/user/avatar/7581/thumb_14-77465e9ce7a34ec1814defb2955a4dea.gif"
    },
    "state": "approved",
    "summary": "666aaaa"
  },
  "note": {
    "note_id": 742857,
    "noteable_id": 66415,
    "noteable_type": "Review",
    "author_id": 7581,
    "note": "666aaaa",
    "project_id": 1070770,
    "start_object_id": "8d879314ed8767fd337c19cdd07ebcea1c793ead",
    "target_object_id": "e969ee7aa2e054e59b677755bc6e283ed3e90a45",
    "file_path": "test.md",
    "system": false,
    "review_state": "approved",
    "created_at": "2019-07-10T08:25:06+0000",
    "updated_at": "2019-07-10T08:25:06+0000"
  }
}

# 项目设置变更事件

当项目的设置变更时,这个 URL 将会被触发,目前支持的设置变更项如下:

类别 配置项名称 标识 适用仓库类型 说明
基础设置 默认分支 default_branch Git 当仓库所指定的默认分支变化时触发
基础设置 项目 Path path Git/SVN 当项目 Path 被修改时触发
基础设置 项目命名空间 namespace_id Git/SVN 当项目被转移到其他命名空间时触发
基础设置 项目全路径 project_full_path Git/SVN 当项目所属的命名空间或者 Path 变动时均会提供此属性

请求头:

X-Event: Project Setting Hook
X-Event-Type: project_setting
X-Source-Type: Project
X-Gitlab-Event: Project Setting Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
    "event_name": "project_setting",
    "object_kind":"project",
    "operation_kind": "update",
    "event_type": "project_setting",
    "user": {
        "name": "git_user1 ",
        "username": "git_user1",
        "id": 7581,
        "avatar_url": "thumb_14-77465e9ce7a34ec1814defb2955a4dea.gif"
    },
    "project_id": 107077,
    "project_full_path": "namespacepath/projectpath",
    "repository":{
        "name": "project",
        "description": "xxxx",
        "homepage": "https://git.tencent.com/namespacepath/projectpath",
        "git_http_url": "https://git.tencent.com/namespacepath/projectpath.git",
        "git_ssh_url": "git@git.tencent.com:username/project.git",
        "url": "git@git.tencent.com:username/project.git",
        "visibility_level": 20
    },
    "object_attributes":{
        "default_branch":{
            "before":"master",
            "after":"main"
        },
        "path":{
          "before": "old_path",
          "after": "new_path"
        },
        "namespace_id": {
          "before": 123,
          "after": 456
        },
        "project_full_path":{
          "before":"group01/testrepo",
          "after":"group02/testrepo"
        }
    },
    "created_at": "2024-04-15T12:36:11+0000",
    "updated_at": "2024-10-24T08:33:15+0000"
}

# 议题事件

创建一个议题或者更新、关闭、重新打开议题时会触发。

请求头:

X-Gitlab-Event: Issue Hook
X-Event: Issue Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "issue",
  "user": {
    "name": "git_user2",
    "username": "git_user2",
    "avatar_url": "https://blog.bobo.com.cn/s/blog_6e572cd60101qls0.html"
  },
  "repository": {
    "name": "issue",
    "url": "https://git.tencent.com/z-413/rename.git",
    "description": "only test",
    "homepage": "https://git.tencent.com/z-413/rename"
  },
  "object_attributes": {
    "id": 19,
    "title": "test",
    "assignee_id": 11323,
    "author_id": 11323,
    "project_id": 15,
    "created_at": "2015-03-13T09:52:25+0000",
    "updated_at": "2015-03-13T09:52:25+0000",
    "position": 0,
    "branch_name": null,
    "description": "null",
    "milestone_id": null,
    "state": "opened",
    "iid": 36,
    "url": "https://git.tencent.com/diaspora/issues/36",
    "action": "open"
  }
}

# 评论事件

对提交、评审或缺陷进行评论时会触发。注释数据将保存在对象属性中 (例如 note, noteable_type)。有效负载还包括关于评论目标的信息,例如: 对一个缺陷的评论,会在"缺陷"键下包括缺陷的具体信息。 有效的目标类型:

  • 提交
  • 评审
  • 缺陷
# 对提交进行评论

请求头:

X-Gitlab-Event: Note Hook
X-Event: Note Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "note",
  "user": {
    "name": "git_user2",
    "username": "git_user2",
    "avatar_url": "https://blog.bobo.com.cn/s/blog_6e572cd60101qls0.html"
  },
  "project_id": 229,
  "repository": {
    "name": "rename",
    "url": "https://localhost/z-413/rename.git",
    "description": "Aut reprehenderit ut est.",
    "homepage": "https://git.tencent.com/z-413/rename"
  },
  "object_attributes": {
    "id": 451,
    "note": "just test ",
    "noteable_type": "Commit",
    "author_id": 23,
    "created_at": "2015-03-13T09:51:06+0000",
    "updated_at": "22015-03-13T09:51:06+0000",
    "project_id": 229,
    "attachment": null,
    "line_code": "1480a4610ca01dd10cb5bc3359a1b1ea568c09a1_3_5",
    "commit_id": "b96850262fabfa9a1d9d28fff9040621958379f9",
    "noteable_id": null,
    "system": false,
    "st_diff": {
      "diff": "xxx",
      "new_path": "z-test",
      "old_path": "z-test",
      "a_mode": "0",
      "b_mode": "160000",
      "new_file": true,
      "renamed_file": false,
      "deleted_file": false
    },
    "url": "https://git.tencent.com/z-413/rename/commit/b96850262fabfa9a8a9d28fff9040621958379f9##note_451"
  },
  "commit": {
    "id": "b96850262fabfa9a8a9d28fff9040621958379f9",
    "message": "a message",
    "timestamp": "2015-03-13T09:51:06+0000",
    "url": "https://git.tencent.com/z-413/rename/commit/b96850262fabfa9a8a9d28fff9040621958379f9",
    "author": {
      "name": "alex",
      "email": "alex@tencent.com"
    }
  }
}
# 对评审进行评论

请求头:

X-Gitlab-Event: Note Hook
X-Event: Note Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "note",
  "user": {
    "name": "git_user2",
    "username": "git_user2",
    "avatar_url": "https://blog.bobo.com.cn/s/blog_6e572cd60101qls0.html"
  },
  "project_id": 229,
  "repository": {
    "name": "rename",
    "url": "https://git.tencent.com/z-413/rename.git",
    "description": "xx",
    "homepage": "https://git.tencent.com/z-413/rename"
  },
  "object_attributes": {
    "id": 294,
    "note": "back",
    "noteable_type": "Review",
    "author_id": 29,
    "created_at": "2015-03-13T09:52:25+0000",
    "updated_at": "2015-03-13T09:52:25+0000",
    "project_id": 14,
    "attachment": null,
    "line_code": null,
    "commit_id": "",
    "noteable_id": 33,
    "system": false,
    "st_diff": null,
    "url": "https://git.tencent.com/z-413/rename/merge_requests/6##note_33"
  },
  "merge_request": {
    "id": 2,
    "target_branch": "fenzhi01",
    "source_branch": "master",
    "source_project_id": 14,
    "author_id": 11322,
    "assignee_id": 33,
    "title": "xx",
    "created_at": "2015-03-13T09:52:25+0000",
    "updated_at": "2015-03-13T09:52:25+0000",
    "milestone_id": 23,
    "state": "opened",
    "merge_status": "go",
    "target_project_id": 14,
    "iid": 3,
    "description": "Revision, not careful.",
    "position": 0,
    "locked_at": null,
    "source": {
      "name": "rename",
      "ssh_url": "git@git.tencent.com:z-413/rename.git",
      "http_url": "http://git.tencent.com:z-413/rename.git",
      "web_url": "https://git.tencent.com:z-413/rename",
      "namespace": "z-413",
      "visibility_level": 10
    },
    "target": {
      "name": "rename",
      "ssh_url": "git@git.tencent.com:z-413/rename.git",
      "http_url": "http://git.tencent.com:z-413/rename.git",
      "web_url": "https://git.tencent.com:z-413/rename",
      "namespace": "z-413",
      "visibility_level": 10
    },
    "last_commit": {
      "id": "1480a4610ca01dd10cb5bc30d8a1b1eab98c09a1",
      "message": "xxx\n",
      "timestamp": "2015-03-15T09:51:06+0000",
      "author_timestamp": "2015-03-15T0:51:06+0000",
      "url": "https://git.tencent.com:z-413/rename/commit/1480a4610ca01dd10cb5bc30d8a1b1eab98c09a1",
      "author": {
        "name": "git_user2",
        "email": "git_user2@tencent.com"
      }
    }
  }
}
# 对缺陷进行评论

请求头:

X-Gitlab-Event: Note Hook
X-Event: Note Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "note",
  "user": {
    "name": "git_user2",
    "username": "git_user2",
    "avatar_url": "https://blog.bobo.com.cn/s/blog_6e572cd60101qls0.html"
  },
  "project_id": 229,
  "repository": {
    "name": "rename",
    "url": "https://git.tencent.com:z-413/rename.git",
    "description": "is usually",
    "homepage": "https://git.tencent.com:z-413/rename.git"
  },
  "object_attributes": {
    "id": 1239,
    "note": "bug",
    "noteable_type": "Issue",
    "author_id": 23,
    "created_at": "2018-03-13T09:51:06+0000",
    "updated_at": "2018-03-13T09:51:06+0000",
    "project_id": 229,
    "attachment": null,
    "line_code": null,
    "commit_id": "",
    "noteable_id": 23,
    "system": false,
    "st_diff": null,
    "url": "https://git.tencent.com:z-413/rename/issues/23##note_229"
  },
  "issue": {
    "id": 8,
    "title": "test",
    "assignee_id": null,
    "author_id": 11323,
    "project_id": 229,
    "created_at": "2018-03-13T09:51:06+0000",
    "updated_at": "2018-03-13T09:51:06+0000",
    "position": 0,
    "branch_name": null,
    "description": "test",
    "milestone_id": null,
    "state": "closed",
    "iid": 66
  }
}

# 锁事件

请求头:

X-Gitlab-Event: Path Lock Hook
X-Event: Path Lock Hook
X-Token: 添加 Hook 时配置的 Token
X-Send-Timestamp: Hook 发送时间时间戳
X-TRACE-ID: 链路追踪ID
X-Gitlab-Token: Hook 配置添加的令牌

请求体:

{
  "object_kind": "path_lock",
  "operation_kind": "create",
  "operation_user": "git_user",
  "operation_user_email": "git_user@tencent.com",
  "object_attributes": [
    {
      "lock_path": "/",
      "branch_name": "commt",
      "lock_owner": "git_user",
      "lock_uid": "59a6bf3b0e8a2218c61ea8c895192cafe3ac66d3",
      "lock_msg": "",
      "project_id": 10834830,
      "created_at": 1678099522808
    }
  ]
}
lastUpdate: 2/5/2026, 3:58:43 PM