# 说明

保存并关联Commit数据,接口会解析commit message,绑定到对应的工作项上

# url

https://api.tapd.cn/code_commit_infos

# 支持格式

JSON/XML(默认JSON格式)

# HTTP请求方式

POST

# 请求数限制

一次插入一条数据

# 请求参数

字段名 必选 类型及范围 说明
workspace_id integer 项目ID
commit_id string 提交ID
author string 代码提交人
message string 提交信息
files array 变更文件
repo string 仓库名
repo_id string/integer 仓库ID
commit_time string 提交时间,2021-10-25 00:00:00
git_env string 信息来源,默认CodeGit
repo_url string 仓库链接,用户界面仓库跳转,留空则不提供跳转能力
commit_url string 提交链接,用户界面上commit提交跳转,留空则不提供跳转能力

# 调用示例及返回结果

# curl 使用 Basic Auth 鉴权调用示例

curl -u 'api_user:api_password' -d '{"workspace_id":20375571,"commit_id":"zxxxxx","commit_time":"2019-07-22 19:11:11","author":"terrysxu","repo":"repos/xxx_proj","repo_id":"abcd1234-avcd-1234-avcd-1234abcdefgh","message":"--story=854927829 ASA-c2s","files":["U xxx.php","A xxx.js","M xxx.html"]}' 'https://api.tapd.cn/code_commit_infos'

# curl 使用 OAuth Access Token 鉴权调用示例

curl -H 'Authorization: Bearer ACCESS_TOKEN' -d '{"workspace_id":20375571,"commit_id":"zxxxxx","commit_time":"2019-07-22 19:11:11","author":"terrysxu","repo":"repos/xxx_proj","repo_id":"abcd1234-avcd-1234-avcd-1234abcdefgh","message":"--story=854927829 ASA-c2s","files":["U xxx.php","A xxx.js","M xxx.html"]}' 'https://api.tapd.cn/code_commit_infos'

# 返回结果

{
    "status": 1,
    "data": {
        "id": "1020375571000321465",
        "hook_user_name": "terrysxu",
        "commit_id": "xxxxx",
        "user_name": "",
        "workspace_id": 20375571,
        "message": "--story=854927829 ASA-c2s",
        "path": "",
        "web_url": "",
        "hook_project_name": "repos/xxx_proj",
        "commit_time": "2019-07-22 19:11:11 +0800 (Mon, 22 Jul 2019)",
        "ref": "",
        "git_env": "CodeGit",
        "file_commit": "{\"U\":[\"xxx.php\"],\"A\":[\"xxx.js\"],\"M\":[\"xxx.html\"]}",
        "repo_id": "abcd1234-avcd-1234-avcd-1234abcdefgh",
        "related": [
            {
                "type": "mini_item",
                "object_id": "1020375571854927829",
                "commit_id": "1020375571000321465",
                "workspace_id": 20375571,
                "code": "SUCCESS"
            }
        ]
    },
    "info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

# 字段说明

# 重要字段说明

字段名 说明
commit_id 提交的版本ID
files 变更文件,数组格式。通过空格分隔操作符和文件名。A表示添加的文件,U表示更新的文件,D表示删除的文件
上次更新: 2023-07-19 15:56:32