CreateCheckRun - Create a check run

Updated at:

Creates or writes back a check run by calling this operation. Updates to existing check runs are not supported.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Obtain the endpoint and use it to replace {domain} in the request syntax.
  • Obtain a personal access token.
  • Obtain the organization ID: Required only for the Central edition. Go to the Basic Information page in the Tenant Management console to obtain the organization ID.

Product

Resource

Required permission

Code Management

Check Run

Read/Write

Request syntax

Central edition

POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/checkRuns

Region edition

POST https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/checkRuns

Request header

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

The repository ID or the URL-encoded full path of the repository.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

-

object

body

No

annotations

array

body

No

The annotation information.

-

object

body

No

annotationLevel

string

body

No

The level of the check annotation. Valid values: notice, warning, and failure.

notice

endColumn

integer

body

No

The end column. This field is valid only when startLine is equal to endLine.

1

endLine

integer

body

No

The end line.

1

message

string

body

No

The summary.

annotation message

path

string

body

No

The file path.

src/test/main.java

rawDetails

string

body

No

The details. The value can be up to 64 KB in size.

annotation raw details text

startColumn

integer

body

No

The start column. This field is valid only when startLine is equal to endLine.

1

startLine

integer

body

No

The start line. The line number must be valid. Otherwise, the annotation is not displayed. The same requirement applies to similar parameters.

1

title

string

body

No

The title of the check annotation.

annotation title

completedAt

string

body

No

The time when the third-party check was completed. The time is in the ISO 8601 format, such as 2024-03-15T08:00:00Z.

2024-10-05T15:30:45Z

conclusion

string

body

No

The conclusion. Valid values: cancelled, failure, neutral (counted as success), success, skipped (counted as success), and timed_out. If you specify a conclusion, the status is automatically set to completed.

success

detailsUrl

string

body

No

The URL of the details page in the third-party system. This URL is user-defined. The platform only redirects users to the URL.

http://example.com

externalId

string

body

No

The user-defined ID in the external system.

1

headSha

string

body

Yes

The commit ID. The commit must be the source of a merge for a new merge request.

6da8c14b5a9102998148b7ea35f96507d5304f74

name

string

body

Yes

The name of the check run. The name can be up to 50 characters in length.

check run name

output

object

body

No

images

array

body

No

The images that can be displayed. You can add up to 3 images.

-

object

body

No

alt

string

body

No

The alt text for the image.

Test

caption

string

body

No

A brief description of the image.

Test Picture

imageUrl

string

body

No

The URL of the image. The URL must be accessible. Otherwise, the image cannot be loaded on the page.

https://example/example/w/100/h/100

summary

string

body

No

The summary. The summary supports the Markdown format and can be up to 64 KB (65,535 characters) in length.

check run output summary

text

string

body

No

The details. The details support the Markdown format and can be up to 64 KB (65,535 characters) in length.

check run output text

title

string

body

No

The title.

check run output title

startedAt

string

body

No

The time when the third-party check started. The time is in the ISO 8601 format, such as 2024-03-15T08:00:00Z.

2024-10-05T15:30:45Z

status

string

body

No

The status. Valid values: queued, in_progress, and completed. If you set the status to completed, you must also specify a conclusion.

completed

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489or60de7a6852743a5162b5f957%2FDemoRepo/checkRuns' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "annotations": [
            {
                "annotationLevel": "notice",
                "endColumn": 1,
                "endLine": 1,
                "message": "annotation message",
                "path": "src/test/main.java",
                "rawDetails": "annotation raw details text",
                "startColumn": 1,
                "startLine": 1,
                "title": "annotation title"
            }
        ],
        "completedAt": "2024-10-05T15:30:45Z",
        "conclusion": "success",
        "detailsUrl": "http://example.com",
        "externalId": "1",
        "headSha": "6da8c14b5a9102998148b7ea35f96507d5304f74",
        "name": "check run name",
        "output": {
            "images": [
                {
                    "alt": "Test",
                    "caption": "Test Picture",
                    "imageUrl": "https://example/example/w/100/h/100"
                }
            ],
            "summary": "check run output summary",
            "text": "check run output text",
            "title": "check run output title"
        },
        "startedAt": "2024-10-05T15:30:45Z",
        "status": "completed"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/repositories/{repository-id-or-uuid}%2FDemoRepo/checkRuns' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "annotations": [
            {
                "annotationLevel": "notice",
                "endColumn": 1,
                "endLine": 1,
                "message": "annotation message",
                "path": "src/test/main.java",
                "rawDetails": "annotation raw details text",
                "startColumn": 1,
                "startLine": 1,
                "title": "annotation title"
            }
        ],
        "completedAt": "2024-10-05T15:30:45Z",
        "conclusion": "success",
        "detailsUrl": "http://example.com",
        "externalId": "1",
        "headSha": "6da8c14b5a9102998148b7ea35f96507d5304f74",
        "name": "check run name",
        "output": {
            "images": [
                {
                    "alt": "Test",
                    "caption": "Test Picture",
                    "imageUrl": "https://example/example/w/100/h/100"
                }
            ],
            "summary": "check run output summary",
            "text": "check run output text",
            "title": "check run output title"
        },
        "startedAt": "2024-10-05T15:30:45Z",
        "status": "completed"
    }'

Response parameters

Parameter

Type

Description

Example

-

object

annotations

array

The annotation information.

-

object

annotationLevel

string

The level of the check annotation. Valid values: notice, warning, and failure.

notice

createdAt

string

The time when the annotation was created.

2024-10-05T15:30:45Z

endColumn

integer

The end column. This field is valid only when startLine is equal to endLine.

2

endLine

integer

The end line.

2

id

integer

The ID of the check annotation. This ID is unique.

1

message

string

The summary.

check run annotation message

path

string

The file path.

src/test/main.java

rawDetails

string

The details. The value can be up to 64 KB in size.

check run annotation raw details text

startColumn

integer

The start column. This field is valid only when startLine is equal to endLine.

1

startLine

integer

The start line. The line number must be valid. Otherwise, the annotation is not displayed. The same requirement applies to similar parameters.

1

title

string

The title of the check annotation.

check run annotation title

updatedAt

string

The time when the annotation was last updated.

2024-10-05T15:30:45Z

checkSuite

object

The information about the check suite.

id

integer

The unique ID.

1

completedAt

string

The time when the third-party check was completed.

2024-10-05T15:30:45Z

conclusion

string

The conclusion. Valid values: cancelled, failure, neutral (counted as success), success, skipped (counted as success), and timed_out.

success

createdAt

string

The time when the write-back record was created.

2024-10-05T15:30:45Z

detailsUrl

string

The URL of the page in the third-party system. This URL is user-defined. The platform only redirects users to the URL.

http://example.test

externalId

string

The ID in the external system.

1

headSha

string

The commit ID.

6da8c14b5a9102998148b7ea35f96507d5304f74

id

integer

The unique ID.

1

name

string

The name of the check run.

Test Check Run

output

object

The information displayed on the page.

images

array

The images that can be displayed. You can add up to 3 images.

-

object

alt

string

The alt text for the image.

Test

caption

string

A brief description of the image.

alt caption

imageUrl

string

The URL of the image. The URL must be accessible. Otherwise, the image cannot be loaded on the page.

https://example/example/w/100/h/100

summary

string

The summary. The summary supports the Markdown format and can be up to 64 KB (65,535 characters) in length.

check run summary

text

string

The details. The details support the Markdown format and can be up to 64 KB (65,535 characters) in length.

check run markdown content text

title

string

The title.

check run title

startedAt

string

The time when the third-party check started.

2024-10-05T15:30:45Z

status

string

The status. Valid values: queued, in_progress, and completed.

completed

updatedAt

string

The time when the write-back record was last updated.

2024-10-05T15:30:45Z

writer

object

The information about the writer.

id

string

The user ID.

62c795xxxb468af8

logoUrl

string

The URL of the user's profile picture.

https://example/example/w/100/h/100

name

string

The username.

codeup-name

slug

string

The logon name of the user.

codeup-username

type

string

The type of the writer. Valid values: User and Bot (not yet available).

User

Response example

{
    "annotations": [
        {
            "annotationLevel": "notice",
            "createdAt": "2024-10-05T15:30:45Z",
            "endColumn": 2,
            "endLine": 2,
            "id": 1,
            "message": "check run annotation message",
            "path": "src/test/main.java",
            "rawDetails": "check run annotation raw details text",
            "startColumn": 1,
            "startLine": 1,
            "title": "check run annotation title",
            "updatedAt": "2024-10-05T15:30:45Z"
        }
    ],
    "checkSuite": {
        "id": 1
    },
    "completedAt": "2024-10-05T15:30:45Z",
    "conclusion": "success",
    "createdAt": "2024-10-05T15:30:45Z",
    "detailsUrl": "http://example.test",
    "externalId": "1",
    "headSha": "6da8c14b5a9102998148b7ea35f96507d5304f74",
    "id": 1,
    "name": "Test Check Run",
    "output": {
        "images": [
            {
                "alt": "Test",
                "caption": "alt caption",
                "imageUrl": "https://example/example/w/100/h/100"
            }
        ],
        "summary": "check run summary",
        "text": "check run markdown content text",
        "title": "check run title"
    },
    "startedAt": "2024-10-05T15:30:45Z",
    "status": "completed",
    "updatedAt": "2024-10-05T15:30:45Z",
    "writer": {
        "id": "62c795xxxb468af8",
        "logoUrl": "https://example/example/w/100/h/100",
        "name": "codeup-name",
        "slug": "codeup-username",
        "type": "User"
    }
}

Error codes

For more information, see Error Code Center.