Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

Git 태그에 대한 REST API 엔드포인트

REST API를 사용하여 GitHub Enterprise Cloud에서 Git 데이터베이스 태그 개체와 상호 작용합니다.

Git 태그 정보

Git 태그는 Git 참조와 유사하지만 Git 태그가 변경되지 않도록 가리키는 Git 커밋입니다. Git 태그는 특정 릴리스를 가리키려는 경우에 유용합니다. 이러한 엔드포인트를 사용하면 GitHub Enterprise Cloud에서 Git 데이터베이스에 태그 개체를 읽고 쓸 수 있습니다. API는 경량 태그가 아닌 주석이 추가된 태그 개체만 지원합니다.

Create a tag object

Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary.

Signature verification object

The response will include a verification object that describes the result of verifying the commit's signature. The following fields are included in the verification object:

NameTypeDescription
verifiedbooleanIndicates whether GitHub considers the signature in this commit to be verified.
reasonstringThe reason for verified value. Possible values and their meanings are enumerated in table below.
signaturestringThe signature that was extracted from the commit.
payloadstringThe value that was signed.

These are the possible values for reason in the verification object:

ValueDescription
expired_keyThe key that made the signature is expired.
not_signing_keyThe "signing" flag is not among the usage flags in the GPG key that made the signature.
gpgverify_errorThere was an error communicating with the signature verification service.
gpgverify_unavailableThe signature verification service is currently unavailable.
unsignedThe object does not include a signature.
unknown_signature_typeA non-PGP signature was found in the commit.
no_userNo user was associated with the committer email address in the commit.
unverified_emailThe committer email address in the commit was associated with a user, but the email address is not verified on their account.
bad_emailThe committer email address in the commit is not included in the identities of the PGP key that made the signature.
unknown_keyThe key that made the signature has not been registered with any user's account.
malformed_signatureThere was an error parsing the signature.
invalidThe signature could not be cryptographically verified using the key whose key-id was found in the signature.
validNone of the above errors applied, so the signature is considered to be verified.

"Create a tag object"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 토큰 형식에서 작동합니다.:

토큰에 다음 권한 집합이 있어야 합니다.:

  • contents:write

"Create a tag object"에 대한 매개 변수

헤더
이름, Type, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, Type, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

본문 매개 변수
이름, Type, 설명
tag string Required

The tag's name. This is typically a version (e.g., "v0.0.1").

message string Required

The tag message.

object string Required

The SHA of the git object this is tagging.

type string Required

The type of the object we're tagging. Normally this is a commit but it can also be a tree or a blob.

다음 중 하나일 수 있습니다.: commit, tree, blob

tagger object

An object with information about the individual creating the tag.

이름, Type, 설명
name string Required

The name of the author of the tag

email string Required

The email of the author of the tag

date string

When this object was tagged. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

"Create a tag object"에 대한 HTTP 응답 상태 코드

상태 코드설명
201

Created

409

Conflict

422

Validation failed, or the endpoint has been spammed.

"Create a tag object"에 대한 코드 샘플

요청 예제

post/repos/{owner}/{repo}/git/tags
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/git/tags \ -d '{"tag":"v0.0.1","message":"initial version","object":"c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c","type":"commit","tagger":{"name":"Monalisa Octocat","email":"octocat@github.com","date":"2011-06-17T14:53:35-07:00"}}'

Response

Status: 201
{ "node_id": "MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==", "tag": "v0.0.1", "sha": "940bd336248efae0f9ee5bc7b2d5c985887b16ac", "url": "https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac", "message": "initial version", "tagger": { "name": "Monalisa Octocat", "email": "octocat@github.com", "date": "2014-11-07T22:01:45Z" }, "object": { "type": "commit", "sha": "c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c", "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c" }, "verification": { "verified": false, "reason": "unsigned", "signature": null, "payload": null } }

Get a tag

Signature verification object

The response will include a verification object that describes the result of verifying the commit's signature. The following fields are included in the verification object:

NameTypeDescription
verifiedbooleanIndicates whether GitHub considers the signature in this commit to be verified.
reasonstringThe reason for verified value. Possible values and their meanings are enumerated in table below.
signaturestringThe signature that was extracted from the commit.
payloadstringThe value that was signed.

These are the possible values for reason in the verification object:

ValueDescription
expired_keyThe key that made the signature is expired.
not_signing_keyThe "signing" flag is not among the usage flags in the GPG key that made the signature.
gpgverify_errorThere was an error communicating with the signature verification service.
gpgverify_unavailableThe signature verification service is currently unavailable.
unsignedThe object does not include a signature.
unknown_signature_typeA non-PGP signature was found in the commit.
no_userNo user was associated with the committer email address in the commit.
unverified_emailThe committer email address in the commit was associated with a user, but the email address is not verified on their account.
bad_emailThe committer email address in the commit is not included in the identities of the PGP key that made the signature.
unknown_keyThe key that made the signature has not been registered with any user's account.
malformed_signatureThere was an error parsing the signature.
invalidThe signature could not be cryptographically verified using the key whose key-id was found in the signature.
validNone of the above errors applied, so the signature is considered to be verified.

"Get a tag"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 토큰 형식에서 작동합니다.:

토큰에 다음 권한 집합이 있어야 합니다.:

  • contents:read

공용 리소스만 요청되는 경우 인증 또는 앞서 언급한 권한 없이 이 엔드포인트를 사용할 수 있습니다.

"Get a tag"에 대한 매개 변수

헤더
이름, Type, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, Type, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

tag_sha string Required

"Get a tag"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

404

Resource not found

409

Conflict

"Get a tag"에 대한 코드 샘플

요청 예제

get/repos/{owner}/{repo}/git/tags/{tag_sha}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/OWNER/REPO/git/tags/TAG_SHA

Response

Status: 200
{ "node_id": "MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==", "tag": "v0.0.1", "sha": "940bd336248efae0f9ee5bc7b2d5c985887b16ac", "url": "https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac", "message": "initial version", "tagger": { "name": "Monalisa Octocat", "email": "octocat@github.com", "date": "2014-11-07T22:01:45Z" }, "object": { "type": "commit", "sha": "c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c", "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c" }, "verification": { "verified": false, "reason": "unsigned", "signature": null, "payload": null } }