文档

GetRepositoryCommit - 查询代码库提交信息

查询代码库的单个提交信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求语法

GET /repository/{repositoryId}/commits/{sha}

请求参数

名称类型必填描述示例值
organizationIdstring

企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】

60de7a6852743a5162b5f957
accessTokenstring

个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段

f0b1e61db5961df5975a93f9129d2513
repositoryIdlong

代码库 ID

2464454
shastring

分支名称、标签名称或 Commit ID

master
showSignatureboolean

展示签名 默认值:false

false

返回参数

名称类型描述示例值
object
requestIdstring

请求 ID

A7586FEB-E48D-5579-983F-74981FBFF627
errorMessagestring

错误信息

""
errorCodestring

错误码

SYSTEM_UNKNOWN_ERROR
successboolean

调用是否成功

true
resultobject

返回结果

idstring

提交 ID(Hash 串)

ff4fb5ac6d1f44f452654336d2dba468ae6c8d04
shortIdstring

简短的提交 ID 例如: CommitID:ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 ShortId:ff4fb5ac

ff4fb5ac
titlestring

提交标题,提交的第一行内容

云效Codeup提交Title
authorNamestring

作者姓名

test-codeup
authorEmailstring

作者邮箱

username@example.com
createdAtstring

创建时间

2022-03-18 14:24:54
messagestring

提交内容

具体的提交内容
authoredDatestring

作者提交时间

2022-03-18 15:00:00
committedDatestring

提交人的提交时间

2022-03-18 15:00:02
committerEmailstring

提交人的邮箱

username@example.com
committerNamestring

提交人的姓名

committer-codeup
parentIdsarray

父提交 ID 列表

string

父提交 ID

de02b625ba8488f92eb204bcb3773a40c1b4ddac
authorobject

作者信息

idlong

Codeup 用户 ID

19927
namestring

用户名称

test-codeup
usernamestring

用户昵称

test-nickname
statestring

状态 可选值:active / blocked,默认值 active

active
avatarUrlstring

头像地址

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100
websiteUrlstring

用户个人网页地址

""
emailstring

用户邮箱

username@example.com
committerobject

提交者信息

idlong

Codeup 用户 ID

24661
namestring

用户名称

committer-codeup
usernamestring

用户昵称

nickname
statestring

状态 可选值:active / blocked

active
avatarUrlstring

头像地址

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100
websiteUrlstring

用户个人网页地址

""
emailstring

用户邮箱

username@example.com
signatureobject

签名信息

gpgKeyIdstring

gpg 签名的 key id

34d2c47c7ce46a5c4639c5ffe208
verificationStatusstring

gpg 校验状态

  • unverified:未校验
  • verified:gpg 公钥验证通过且邮箱一致
  • same_user_different_email:gpg 公钥验签通过,提交者邮箱属于当前用户,但与证书邮箱不一致
  • other_user:gpg 公钥验签通过,但提交者邮箱不属于 key 的用户
  • unverified_key:key 对应的邮箱,不在该用户的邮箱列表中
  • unknown_key:gpg key 不存在
verified
commentsCountlong

评论数量

1

示例

正常返回示例

JSON格式

{
  "requestId": "A7586FEB-E48D-5579-983F-74981FBFF627",
  "errorMessage": "\"\"",
  "errorCode": "SYSTEM_UNKNOWN_ERROR",
  "success": true,
  "result": {
    "id": "ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 ",
    "shortId": "ff4fb5ac",
    "title": "云效Codeup提交Title",
    "authorName": "test-codeup",
    "authorEmail": "username@example.com",
    "createdAt": "2022-03-18 14:24:54",
    "message": "具体的提交内容",
    "authoredDate": "2022-03-18 15:00:00",
    "committedDate": "2022-03-18 15:00:02",
    "committerEmail": "username@example.com\n",
    "committerName": "committer-codeup",
    "parentIds": [
      "de02b625ba8488f92eb204bcb3773a40c1b4ddac"
    ],
    "author": {
      "id": 19927,
      "name": "test-codeup",
      "username": "test-nickname",
      "state": "active",
      "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100",
      "websiteUrl": "\"\"",
      "email": "username@example.com"
    },
    "committer": {
      "id": 24661,
      "name": "committer-codeup",
      "username": "nickname",
      "state": "active",
      "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100",
      "websiteUrl": "\"\"",
      "email": "username@example.com"
    },
    "signature": {
      "gpgKeyId": "34d2c47c7ce46a5c4639c5ffe208",
      "verificationStatus": "verified"
    },
    "commentsCount": 1
  }
}

错误码

HTTP status code错误码错误信息描述
403Forbidden.AccessDeniedThe user is not authorized to perform the operation.用户无权限执行相关操作
403Forbidden.UserNotInCurrentOrganizationThe user is not in the organization and is not authorized to perform the operation.当前用户不在该企业中,无权进行操作。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2023-07-24OpenAPI 错误码发生变更、OpenAPI 返回结构发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:403
出参OpenAPI 返回结构发生变更
2022-11-15新增 OpenAPI看变更集
  • 本页导读 (0)
文档反馈