리포지토리 서브모듈 API

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

기존 서브모듈 참조 업데이트하기

일부 워크플로에서 특히 자동화된 경우에는 해당 서브모듈을 사용하는 다른 프로젝트를 최신 상태로 유지하기 위해 서브모듈의 참조를 업데이트하는 것이 유용할 수 있습니다. 이 엔드포인트를 사용하여 특정 브랜치에서 Git 서브모듈 참조를 업데이트할 수 있습니다.

PUT /projects/:id/repository/submodules/:submodule
속성 유형 필수 여부 설명
id integer/string 인증된 사용자가 소유한 프로젝트의 ID 또는 URL 인코딩된 경로
submodule string 서브모듈의 URL 인코딩된 전체 경로입니다. 예: lib%2Fclass%2Erb
branch string 커밋할 브랜치의 이름
commit_sha string 서브모듈을 업데이트할 전체 커밋 SHA
commit_message string 아니요 커밋 메시지입니다. 메시지를 제공하지 않으면 기본값이 설정됩니다.
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/submodules/lib%2Fmodules%2Fexample" \
--data "branch=main&commit_sha=3ddec28ea23acc5caa5d8331a6ecb2a65fc03e88&commit_message=서브모듈 참조 업데이트"

예시 응답:

{
  "id": "ed899a2f4b50b4370feeea94676502b42383c746",
  "short_id": "ed899a2f4b5",
  "title": "3ddec28ea23acc5caa5d8331a6ecb2a65fc03e88로 서브모듈 example_submodule 업데이트",
  "author_name": "Dmitriy Zaporozhets",
  "author_email": "dzaporozhets@sphereconsultinginc.com",
  "committer_name": "Dmitriy Zaporozhets",
  "committer_email": "dzaporozhets@sphereconsultinginc.com",
  "created_at": "2018-09-20T09:26:24.000-07:00",
  "message": "3ddec28ea23acc5caa5d8331a6ecb2a65fc03e88로 서브모듈 example_submodule 업데이트",
  "parent_ids": [
    "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
  ],
  "committed_date": "2018-09-20T09:26:24.000-07:00",
  "authored_date": "2018-09-20T09:26:24.000-07:00",
  "status": null
}