文档

CreateCheckRun - 添加检查运行记录

添加检查运行记录,仅创建。

调试

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

授权信息

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

请求语法

POST /api/v4/projects/check_runs/create_check_run

请求参数

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

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

5ebbc0228123212b59xxxxx
accessTokenstring

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

f0b1e61db5961df5975a93f9129d2513
repositoryIdentitystring

代码库 ID 或者全路径

2835387 或 codeup/codeup-demo
bodyobject

请求 Body

namestring

检查运行的名称

说明 在一定环境下(指定代码库、提交 ID、写入人),名称具有唯一性;长度限制在 50 以内
my-check-ci
headShastring

提交 ID

说明 Commit SHA,但需要确保该 commit 是某个合并请求的合并源
40f4ccfe019cdd4a62d4acb0c57130106fc7e1be
statusstring

状态

  • queued:队列中
  • in_progress:运行中
  • completed:已完结
completed
conclusionstring

结论

  • cancelled:已取消
  • failure:失败
  • neutral:中立状态,算作成功状态
  • success:成功
  • skipped:跳过,算作成功状态
  • timed_out:超时
success
startedAtstring

检查运行的开始时间

说明 ISO 8601 格式:YYYY-MM-DDTHH:MM:SSZ,如 2023-03-15T08:00:00Z
2023-03-15T08:00:00Z
completedAtstring

检查运行的完结时间

说明 说明 ISO 8601 格式:YYYY-MM-DDTHH:MM:SSZ,如 2023-03-15T08:00:00Z
2023-03-15T08:00:00Z
externalIdstring

外部系统的 ID

说明 外部系统,指用户的检测系统;该字段由用户自行决定写入何种 ID,平台仅使用字符串类型进行存储
42
detailsUrlstring

三方交互系统的详情地址,由用户自行决定,平台仅提供跳转能力

xxx
outputobject

各类展示信息

titlestring

UI 模块的标题(非 name)

Mighty Readme report
summarystring

检查运行的摘要信息

说明 支持 markdown 格式;最大字符长度为 64KB,即 65535 个字符
摘要信息内容
textstring

详情信息

说明 支持 markdown 格式;最大字符长度为 64KB,即 65535 个字符
详情信息内容
imagesobject []

图片信息

说明 check run 支持在 output 的展示模块中,展示图片信息
altstring

alt 文本信息

test-image-alt
imageUrlstring

图片地址,须确保能够有效访问,否则页面无法展示

xxx
captionstring

图片信息的简要描述

test
annotationsobject []

检查注释列表

说明 对于某些三方系统,可能会获得代码质量检测结果,若希望进行展示,可通过 API 将信息通过 annotation 写入到 check run 中。
pathstring

文件路径

demo/test.txt
startLinelong

起始行

说明 从 1 开始;需要用户自行确保文件行数的有效性,否则无法展示
1
endLinelong

结束行

2
startColumnlong

起始列

说明 当且仅当 startLine=endLine 时,该字段值有效
3
endColumnlong

结束列

说明 当且仅当 startLine=endLine 时,该字段值有效
5
annotationLevelstring

检查注释的等级

  • notice:轻微
  • warning:警告
  • failure:严重
notice
messagestring

简要描述信息

回写检查注释的简要描述信息
titlestring

检查注释的标题

检查注释的标题
rawDetailsstring

详情信息,限制 64KB 以内的大小

详情信息内容

返回参数

名称类型描述示例值
object

Schema of Response

requestIdstring

请求 ID

ASSDS-ASSASX-XSAXSA-XSAXSAXS
successboolean

调用是否成功

true
errorCodestring

错误码

SYSTEM_UNKNOWN_ERROR
errorMessagestring

错误信息

""
resultobject

返回结果

idlong

唯一标识

524836
createdAtstring

创建时间

2022-01-14T21:08:26+08:00
updatedAtstring

更新时间

2022-01-14T21:08:26+08:00
startedAtstring

开始时间

2023-03-15T08:00:00Z
completedAtstring

完结时间

2023-03-15T08:00:00Z
externalIdstring

外部系统 ID

42
namestring

名称

my-check-ci
headShastring

提交 ID

40f4ccfe019cdd4a62d4acb0c57130106fc7e1be
statusstring

状态

  • queued:队列中
  • in_progress:运行中
  • completed:已完结
completed
conclusionstring

结论

  • cancelled:已取消
  • failure:失败
  • neutral:中立状态,算作成功
  • success:成功
  • skipped:跳过,算作成功状态
  • timed_out:超时
success
detailsUrlstring

三方交互系统的详情地址,由用户自行决定,平台仅提供跳转能力

xxx
checkSuiteobject

检查套件

idlong

检查套件 ID,唯一标识

1
writerobject

写入人简要信息

idstring

用户阿里云账号 ID

xxx
typestring

写入人类型

  • User:用户类型
User
namestring

写入人名称

test-codeup
slugstring

别名

test-codeup
logoUrlstring

写入人头像地址

xxx
outputobject

页面展示信息

titlestring

UI 模块的标题(非 name)

Mighty Readme report
summarystring

检查运行的摘要信息

说明 支持 markdown 格式;最大字符长度为 64KB,即 65535 个字符
摘要信息内容
textstring

详情信息

说明 支持 markdown 格式;最大字符长度为 64KB,即 65535 个字符
详情信息内容
imagesobject []

图片信息列表

说明 check run 支持在 output 的展示模块中,展示图片信息
altstring

alt 文本信息

test-image-alt
imageUrlstring

图片地址,须确保能够有效访问,否则页面无法展示

xxx
captionstring

图片信息的简要描述

test
annotationsobject []

检查注释列表

说明 对于某些三方系统,可能会获得代码质量检测结果,若希望进行展示,可通过 API 将信息通过 annotation 写入到 check run 中。
idlong

检查注释 ID,唯一标识

2
pathstring

文件路径

demo/test.txt
startLinelong

起始行

说明 从 1 开始;需要用户自行确保文件行数的有效性,否则无法展示
1
endLinelong

结束行

2
startColumnlong

起始列

说明 当且仅当 startLine=endLine 时,该字段值有效
3
endColumnlong

结束列

说明 当且仅当 startLine=endLine 时,该字段值有效
5
annotationLevelstring

检查注释的等级

  • notice:轻微
  • warning:警告
  • failure:严重
notice
messagestring

简要描述信息

回写检查注释的简要描述信息
titlestring

检查注释的标题

检查注释的标题
rawDetailsstring

详情信息,限制 64KB 以内的大小

详情信息

示例

正常返回示例

JSON格式

{
  "requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
  "success": true,
  "errorCode": "SYSTEM_UNKNOWN_ERROR",
  "errorMessage": "\"\"",
  "result": {
    "id": 524836,
    "createdAt": "2022-01-14T21:08:26+08:00",
    "updatedAt": "2022-01-14T21:08:26+08:00",
    "startedAt": "2023-03-15T08:00:00Z",
    "completedAt": "2023-03-15T08:00:00Z",
    "externalId": "42",
    "name": "my-check-ci\n",
    "headSha": "40f4ccfe019cdd4a62d4acb0c57130106fc7e1be",
    "status": "completed",
    "conclusion": "success",
    "detailsUrl": "xxx",
    "checkSuite": {
      "id": 1
    },
    "writer": {
      "id": "xxx",
      "type": "User",
      "name": "test-codeup",
      "slug": "test-codeup",
      "logoUrl": "xxx"
    },
    "output": {
      "title": "Mighty Readme report\n",
      "summary": "摘要信息内容\n",
      "text": "详情信息内容\n",
      "images": [
        {
          "alt": "test-image-alt",
          "imageUrl": "xxx",
          "caption": "test"
        }
      ]
    },
    "annotations": [
      {
        "id": 2,
        "path": "demo/test.txt",
        "startLine": 1,
        "endLine": 2,
        "startColumn": 3,
        "endColumn": 5,
        "annotationLevel": "notice",
        "message": "回写检查注释的简要描述信息\n",
        "title": "检查注释的标题",
        "rawDetails": "详情信息"
      }
    ]
  }
}

错误码

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

  • 本页导读 (0)
文档反馈