+ Create webhook with access token;

This commit is contained in:
dingguodong
2021-06-29 16:47:09 +08:00
parent 812b048621
commit ad41a07d36
+6 -1
View File
@@ -233,6 +233,10 @@ class gitlabModel extends model
{
$apiRoot = $this->getApiRoot($gitlabID);
$accessToken = $this->dao->select('private as accessToken')->from(TABLE_PIPELINE)
->where('id')->eq($gitlabID)
->fetch('accessToken');
$postData = new stdclass;
$postData->enable_ssl_verification = "false";
$postData->issues_events = "true";
@@ -240,7 +244,8 @@ class gitlabModel extends model
$postData->push_events = "true";
$postData->tag_push_events = "true";
$postData->url = $url;
$postData->token = $accessToken;
$url = sprintf($apiRoot, "/projects/{$projectID}/hooks");
return commonModel::http($url, $postData);
}