Skip to content

Commit 800a1e9

Browse files
authored
[11.5] Fix release creation/update API paths (#654)
1 parent 607986a commit 800a1e9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Api/Repositories.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function createTag($project_id, string $name, string $ref, ?string $messa
152152
*/
153153
public function createRelease($project_id, string $tag_name, string $description)
154154
{
155-
return $this->post($this->getProjectPath($project_id, 'repository/tags/'.self::encodePath($tag_name).'/release'), [
155+
return $this->post($this->getProjectPath($project_id, 'releases'), [
156156
'id' => $project_id,
157157
'tag_name' => $tag_name,
158158
'description' => $description,
@@ -168,7 +168,7 @@ public function createRelease($project_id, string $tag_name, string $description
168168
*/
169169
public function updateRelease($project_id, string $tag_name, string $description)
170170
{
171-
return $this->put($this->getProjectPath($project_id, 'repository/tags/'.self::encodePath($tag_name).'/release'), [
171+
return $this->put($this->getProjectPath($project_id, 'releases/'.self::encodePath($tag_name)), [
172172
'id' => $project_id,
173173
'tag_name' => $tag_name,
174174
'description' => $description,

tests/Api/RepositoriesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function shouldCreateRelease(): void
195195
$api = $this->getApiMock();
196196
$api->expects($this->once())
197197
->method('post')
198-
->with('projects/'.$project_id.'/repository/tags/'.$tagName.'/release', [
198+
->with('projects/'.$project_id.'/releases', [
199199
'id' => $project_id,
200200
'tag_name' => $tagName,
201201
'description' => $description,
@@ -220,7 +220,7 @@ public function shouldUpdateRelease(): void
220220
$api = $this->getApiMock();
221221
$api->expects($this->once())
222222
->method('put')
223-
->with('projects/'.$project_id.'/repository/tags/'.$tagName.'/release', [
223+
->with('projects/'.$project_id.'/releases/'.$tagName, [
224224
'id' => $project_id,
225225
'tag_name' => $tagName,
226226
'description' => $description,

0 commit comments

Comments
 (0)