您好我想創建一個標籤來使用gitlab API的一個項目,但它口口聲聲說標籤名無效。我甚至嘗試在gitlab API文檔中使用該示例。gitlab API標籤創建錯誤
這裏是我的嘗試:
➜ /tmp curl -X POST -d @body.json https://mygitlabserver.com/api/v3/projects/9733/repository/tags --header "Content-Type:application/json" -H "PRIVATE-TOKEN:sNW8AGtLMdSGAJiGQ-gV"
{"message":"Tag name invalid"}%
➜ /tmp cat body.json
{
"commit": {
"author_email": "[email protected]",
"author_name": "John Smith",
"authored_date": "2012-05-28T04:42:42-07:00",
"committed_date": "2012-05-28T04:42:42-07:00",
"committer_email": "[email protected]",
"committer_name": "Jack Smith",
"id": "2695effb5807a22ff3d138d593fd856244e155e7",
"message": "Initial commit",
"parents_ids": [
"2a4b78934375d7f53875269ffd4f45fd83a84ebe"
]
},
"message": null,
"name": "v1.0.0",
"release": {
"description": "Amazing release. Wow",
"tag_name": "1.0.0"
}
}
謝謝你,但它仍然是相同的 ➜/ tmp目錄捲曲-X POST -d @ body.json https://mygitlabserver.com/api/ V3 /項目/ 9733 /庫/標籤--header 「內容類型:應用程序/ JSON」 -H 「PRIVATE-TOKEN:sNW8AGtLMdSGAJiGQ-GV」 { 「消息」: 「標籤名稱無效」}%➜/ tmp目錄貓體.json { 「message」:null, 「name」:「tags/v1.0.0」 } 我想這就是你叫我來試試呢?如果不是可以請詳細說明嗎?\ –
@PramodSetlur嘗試並修改https://github.com/gitlabhq/gitlabhq/blob/91fa250038e9182988319f088fb84741b6e2efc9/lib/gitlab/git_ref_validator.rb以添加更多跟蹤,以查看確切的git命令運行。 – VonC
無法訪問託管API的盒子。 :/ –