GetRepositoryCommit

Updated at:

Queries the information about a single commit in a code repository.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

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

Path Parameters

Parameter

Type

Required

Description

Example

repositoryId

integer

Yes

The ID of the code repository.

2464454

sha

string

Yes

The branch name, tag name, or commit ID.

master

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The enterprise identifier, also known as the enterprise ID. This is a string value that you can obtain from the Yunxiao URL, such as https://devops.aliyun.com/organization/[OrganizationId].

60de7a6852743a5162b5f957

accessToken

string

No

The personal access token. You do not need to specify this parameter if you use an Alibaba Cloud AccessKey pair or Security Token Service (STS) for temporary authorization.

f0b1e61db5961df5975a93f9129d2513

showSignature

boolean

No

Specifies whether to show the signature. Default value: false.

false

Response elements

Element

Type

Description

Example

object

requestId

string

The ID of the request.

A7586FEB-E48D-5579-983F-74981FBFF627

errorMessage

string

The error message.

""

errorCode

string

The error code.

SYSTEM_UNKNOWN_ERROR

success

boolean

Indicates whether the call was successful.

true

result

object

The returned result.

id

string

The commit ID, which is a hash string.

ff4fb5ac6d1f44f452654336d2dba468ae6c8d04

shortId

string

The short commit ID. Example: Commit ID: ff4fb5ac6d1f44f452654336d2dba468ae6c8d04. Short ID: ff4fb5ac.

ff4fb5ac

title

string

The commit title, which is the first line of the commit message.

Yunxiao Codeup commit title

authorName

string

The name of the author.

test-codeup

authorEmail

string

The email address of the author.

username@example.com

createdAt

string

The creation time. The format is YYYY-MM-DD HH:mm:ss.

2022-03-18 14:24:54

message

string

The commit message.

Specific commit message

authoredDate

string

The time when the author made the commit. The format is YYYY-MM-DD HH:mm:ss.

2022-03-18 15:00:00

committedDate

string

The time when the committer made the commit. The format is YYYY-MM-DD HH:mm:ss.

2022-03-18 15:00:02

committerEmail

string

The email address of the committer.

username@example.com

committerName

string

The name of the committer.

committer-codeup

parentIds

array

The list of parent commit IDs.

string

The parent commit ID.

de02b625ba8488f92eb204bcb3773a40c1b4ddac

author

object

The author information.

id

integer

The Codeup user ID.

19927

name

string

The username.

test-codeup

username

string

The user nickname.

test-nickname

state

string

The status. Valid values:

  • active: Active.

  • blocked: Blocked. Default value: active.

active

avatarUrl

string

The URL of the avatar.

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

websiteUrl

string

The URL of the user's personal website.

""

email

string

The email address of the user.

username@example.com

committer

object

The committer information.

id

integer

The Codeup user ID.

24661

name

string

The username.

committer-codeup

username

string

The user nickname.

nickname

state

string

The status. Valid values:

  • active: Active.

  • blocked: Blocked.

active

avatarUrl

string

The URL of the avatar.

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

websiteUrl

string

The URL of the user's personal website.

""

email

string

The email address of the user.

username@example.com

signature

object

The signature information.

gpgKeyId

string

The key ID of the GPG signature.

34d2c47c7ce46a5c4639c5ffe208

verificationStatus

string

The GPG verification status. Valid values:

  • unverified: Unverified.

  • verified: The GPG public key is verified and the email address matches.

  • same_user_different_email: The GPG public key signature is verified, and the committer email address belongs to the current user but does not match the certificate email address.

  • other_user: The GPG public key signature is verified, but the committer email address does not belong to the key user.

  • unverified_key: The email address corresponding to the key is not in the email address list of the user.

  • unknown_key: The GPG key does not exist.

verified

commentsCount

integer

The number of comments.

1

Examples

Success response

JSON format

{
  "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
  }
}

Error codes

HTTP status code

Error code

Error message

Description

403 Forbidden.AccessDenied The user is not authorized to perform the operation. The user is not authorized to perform the operation.
403 Forbidden.UserNotInCurrentOrganization The user is not in the organization and is not authorized to perform the operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.