* Finish task #46140.

This commit is contained in:
liyuchun
2021-12-21 16:55:55 +08:00
parent b7ce8814fb
commit b9a2d19393
6 changed files with 48 additions and 1 deletions
+18
View File
@@ -1503,6 +1503,24 @@ class gitlabModel extends model
}
}
/**
* Delete a gitab tag by api.
*
* @param int $gitlabID
* @param int $projectID
* @param string $tagName
* @access public
* @return object
*/
public function apiDeleteTag($gitlabID, $projectID, $tagName = '')
{
if(!(int)$gitlabID or !(int)$projectID or empty($tagName)) return false;
$apiRoot = $this->getApiRoot($gitlabID);
$url = sprintf($apiRoot, "/projects/{$projectID}/repository/tags/{$tagName}");
return json_decode(commonModel::http($url, array(), $options = array(CURLOPT_CUSTOMREQUEST => 'DELETE')));
}
/**
* Check webhook token by HTTP_X_GITLAB_TOKEN.
*