태그 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

프로젝트 리포지토리 태그 목록

  • version 값은 order_by 속성에 대해 도입됨 GitLab 15.4.
  • created_at 응답 속성 도입됨 GitLab 16.11.

프로젝트의 리포지토리 태그 목록을 가져오고, 업데이트 날짜와 시간에 따라 내림차순으로 정렬합니다.

참고:
리포지토리가 공개적으로 접근 가능하다면, 인증
(--header "PRIVATE-TOKEN: <your_access_token>")이 필요하지 않습니다.

GET /projects/:id/repository/tags

매개변수:

속성 유형 필수 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로.
order_by 문자열 아니오 name, updated, 또는 version으로 정렬된 태그 반환. 기본값은 updated입니다.
sort 문자열 아니오 asc 또는 desc 순서로 정렬된 태그 반환. 기본값은 desc입니다.
search 문자열 아니오 검색 기준과 일치하는 태그 목록 반환. ^termterm$를 사용하여 term으로 시작하고 끝나는 태그를 찾을 수 있습니다. 다른 정규 표현식은 지원되지 않습니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" \
    --url "https://gitlab.example.com/api/v4/projects/5/repository/tags"

예시 응답:

[
  {
    "commit": {
      "id": "2695effb5807a22ff3d138d593fd856244e155e7",
      "short_id": "2695effb",
      "title": "초기 커밋",
      "created_at": "2017-07-26T11:08:53.000+02:00",
      "parent_ids": [
        "2a4b78934375d7f53875269ffd4f45fd83a84ebe"
      ],
      "message": "초기 커밋",
      "author_name": "존 스미스",
      "author_email": "john@example.com",
      "authored_date": "2012-05-28T04:42:42-07:00",
      "committer_name": "잭 스미스",
      "committer_email": "jack@example.com",
      "committed_date": "2012-05-28T04:42:42-07:00"
    },
    "release": {
      "tag_name": "1.0.0",
      "description": "놀라운 릴리스. 와우"
    },
    "name": "v1.0.0",
    "target": "2695effb5807a22ff3d138d593fd856244e155e7",
    "message": null,
    "protected": true,
    "created_at": "2017-07-26T11:08:53.000+02:00"
  }
]

단일 레포지토리 태그 가져오기

  • created_at 응답 속성 도입됨 GitLab 16.11에서.

이름으로 결정된 특정 레포지토리 태그를 가져옵니다. 레포지토리가 공개적으로 접근 가능하다면 인증 없이 이 엔드포인트에 접근할 수 있습니다.

GET /projects/:id/repository/tags/:tag_name

매개변수:

속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL-인코딩된 경로입니다.
tag_name 문자열 태그의 이름입니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/tags/v1.0.0"

예시 응답:

{
  "name": "v5.0.0",
  "message": null,
  "target": "60a8ff033665e1207714d6670fcd7b65304ec02f",
  "commit": {
    "id": "60a8ff033665e1207714d6670fcd7b65304ec02f",
    "short_id": "60a8ff03",
    "title": "초기 커밋",
    "created_at": "2017-07-26T11:08:53.000+02:00",
    "parent_ids": [
      "f61c062ff8bcbdb00e0a1b3317a91aed6ceee06b"
    ],
    "message": "v5.0.0\n",
    "author_name": "Arthur Verschaeve",
    "author_email": "contact@arthurverschaeve.be",
    "authored_date": "2015-02-01T21:56:31.000+01:00",
    "committer_name": "Arthur Verschaeve",
    "committer_email": "contact@arthurverschaeve.be",
    "committed_date": "2015-02-01T21:56:31.000+01:00"
  },
  "release": null,
  "protected": false,
  "created_at": "2017-07-26T11:08:53.000+02:00"
}

새 태그 만들기

  • created_at 응답 속성 도입됨 GitLab 16.11에서.

제공된 ref를 가리키는 레포지토리에 새 태그를 생성합니다.

POST /projects/:id/repository/tags

매개변수:

속성 유형 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL-인코딩된 경로입니다.
tag_name 문자열 태그의 이름입니다.
ref 문자열 커밋 SHA, 다른 태그 이름 또는 브랜치 이름에서 태그를 생성합니다.
message 문자열 아니오 주석 태그를 생성합니다.
curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/5/repository/tags?tag_name=test&ref=main"

예시 응답:

{
  "commit": {
    "id": "2695effb5807a22ff3d138d593fd856244e155e7",
    "short_id": "2695effb",
    "title": "초기 커밋",
    "created_at": "2017-07-26T11:08:53.000+02:00",
    "parent_ids": [
      "2a4b78934375d7f53875269ffd4f45fd83a84ebe"
    ],
    "message": "초기 커밋",
    "author_name": "John Smith",
    "author_email": "john@example.com",
    "authored_date": "2012-05-28T04:42:42-07:00",
    "committer_name": "Jack Smith",
    "committer_email": "jack@example.com",
    "committed_date": "2012-05-28T04:42:42-07:00"
  },
  "release": null,
  "name": "v1.0.0",
  "target": "2695effb5807a22ff3d138d593fd856244e155e7",
  "message": null,
  "protected": false,
  "created_at": null
}

생성된 태그의 유형은 created_at, targetmessage의 내용을 결정합니다:

  • 주석 태그의 경우:
    • created_at은 태그 생성의 타임스탬프를 포함합니다.
    • message는 주석을 포함합니다.
    • target은 태그 객체의 ID를 포함합니다.
  • 경량 태그의 경우:
    • created_at은 null입니다.
    • message는 null입니다.
    • target은 커밋 ID를 포함합니다.

오류는 설명이 포함된 오류 메시지와 함께 상태 코드 405를 반환합니다.

태그 삭제

주어진 이름의 저장소 태그를 삭제합니다.

DELETE /projects/:id/repository/tags/:tag_name

매개변수:

속성 타입 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로입니다.
tag_name 문자열 태그의 이름입니다.

태그의 X.509 서명 가져오기

서명된 경우 태그에서 X.509 서명을 가져옵니다.

서명되지 않은 태그는 404 Not Found 응답을 반환합니다.

GET /projects/:id/repository/tags/:tag_name/signature

매개변수:

속성 타입 필수 여부 설명
id 정수 또는 문자열 프로젝트의 ID 또는 URL 인코딩된 경로입니다.
tag_name 문자열 태그의 이름입니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/repository/tags/v1.1.1/signature"

태그가 X.509 서명된 경우의 예시 응답:

{
  "signature_type": "X509",
  "verification_status": "unverified",
  "x509_certificate": {
    "id": 1,
    "subject": "CN=gitlab@example.org,OU=Example,O=World",
    "subject_key_identifier": "BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC:BC",
    "email": "gitlab@example.org",
    "serial_number": 278969561018901340486471282831158785578,
    "certificate_status": "good",
    "x509_issuer": {
      "id": 1,
      "subject": "CN=PKI,OU=Example,O=World",
      "subject_key_identifier": "AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB:AB",
      "crl_url": "http://example.com/pki.crl"
    }
  }
}

태그가 서명되지 않은 경우의 예시 응답:

{
  "message": "404 GPG Signature Not Found"
}