UpdateCheckRun - Update a check run

Updated at:

Updates a check run by specifying the check run ID, status, conclusion, annotations, and output.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Obtain an endpoint: Replace {domain} in the API request syntax.
  • Obtain a personal access token.
  • Obtain the organizationId: Required only for the Central edition. Go to the Basic Information page in the Organization Management console to retrieve the organization ID.

Product

Resource

Required permission

Code Management

Check run

Read and write

Request syntax

Central edition

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

Region edition

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

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Personal access token.

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

Request parameters

Parameter

Type

Position

Required

Description

Example

organizationId

string

path

  • Yes for the Central edition.

  • No for the 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

checkRunId

integer

path

Yes

The unique ID of the check run.

1

-

object

body

No

annotations

array

body

No

The annotation information.

-

object

body

No

annotationLevel

string

body

No

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

notice

endColumn

integer

body

No

The end column. Valid only when startLine equals 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 raw details. Maximum size: 64 KB.

annotation raw details text

startColumn

integer

body

No

The start column. Valid only when startLine equals endLine.

1

startLine

integer

body

No

The start line. The line number must be valid within the file; otherwise, the annotation cannot be displayed. This rule also applies to other line and column parameters.

1

title

string

body

No

The annotation title.

annotation title

completedAt

string

body

No

The time when the third-party check was completed, in ISO 8601 format. Example: 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. Setting a conclusion automatically sets the status to completed.

success

detailsUrl

string

body

No

The URL of the details page in the third-party system. You can specify this URL. The platform only redirects to this URL.

http://example.com

externalId

string

body

No

The ID from an external system. You can specify this value.

1

name

string

body

No

The check run name. Maximum length: 50 characters.

check run name

output

object

body

No

images

array

body

No

The images to display. Maximum: 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 image URL. The URL must be accessible; otherwise, the image cannot be loaded.

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

summary

string

body

No

The summary in Markdown format. Maximum size: 64 KB (65,535 characters).

check run output summary

text

string

body

No

The detailed text in Markdown format. Maximum size: 64 KB (65,535 characters).

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, in ISO 8601 format. Example: 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 conclusion.

completed

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489/checkRuns/1' \
  -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",
        "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/2813489/checkRuns/1' \
  -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",
        "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 annotation level. 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. Valid only when startLine equals endLine.

2

endLine

integer

The end line.

2

id

integer

The unique ID of the check annotation.

1

message

string

The summary.

check run annotation message

path

string

The file path.

src/test/main.java

rawDetails

string

The raw details. Maximum size: 64 KB.

check run annotation raw details text

startColumn

integer

The start column. Valid only when startLine equals endLine.

1

startLine

integer

The start line. The line number must be valid within the file for the annotation to be displayed. This rule also applies to other line and column 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 check suite information.

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 that links to the third-party system. The platform only redirects to this URL.

http://example.test

externalId

string

The ID from 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 output displayed on the check run page.

images

array

The images to display. Maximum: 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 image URL. The URL must be accessible; otherwise, the image cannot be loaded.

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

summary

string

The summary in Markdown format. Maximum size: 64 KB (65,535 characters).

check run summary

text

string

The detailed text in Markdown format. Maximum size: 64 KB (65,535 characters).

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 writer information.

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 login name of the user.

codeup-username

type

string

The writer type. 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 error codes, see Error Code Center.