diff --git a/src/Api/Repositories.php b/src/Api/Repositories.php index c080c161..6915d92d 100644 --- a/src/Api/Repositories.php +++ b/src/Api/Repositories.php @@ -152,7 +152,7 @@ public function createTag($project_id, string $name, string $ref, ?string $messa */ public function createRelease($project_id, string $tag_name, string $description) { - return $this->post($this->getProjectPath($project_id, 'repository/tags/'.self::encodePath($tag_name).'/release'), [ + return $this->post($this->getProjectPath($project_id, 'releases'), [ 'id' => $project_id, 'tag_name' => $tag_name, 'description' => $description, @@ -168,7 +168,7 @@ public function createRelease($project_id, string $tag_name, string $description */ public function updateRelease($project_id, string $tag_name, string $description) { - return $this->put($this->getProjectPath($project_id, 'repository/tags/'.self::encodePath($tag_name).'/release'), [ + return $this->put($this->getProjectPath($project_id, 'releases/'.self::encodePath($tag_name)), [ 'id' => $project_id, 'tag_name' => $tag_name, 'description' => $description, diff --git a/tests/Api/RepositoriesTest.php b/tests/Api/RepositoriesTest.php index 221f3ede..54cf1c5e 100644 --- a/tests/Api/RepositoriesTest.php +++ b/tests/Api/RepositoriesTest.php @@ -195,7 +195,7 @@ public function shouldCreateRelease(): void $api = $this->getApiMock(); $api->expects($this->once()) ->method('post') - ->with('projects/'.$project_id.'/repository/tags/'.$tagName.'/release', [ + ->with('projects/'.$project_id.'/releases', [ 'id' => $project_id, 'tag_name' => $tagName, 'description' => $description, @@ -220,7 +220,7 @@ public function shouldUpdateRelease(): void $api = $this->getApiMock(); $api->expects($this->once()) ->method('put') - ->with('projects/'.$project_id.'/repository/tags/'.$tagName.'/release', [ + ->with('projects/'.$project_id.'/releases/'.$tagName, [ 'id' => $project_id, 'tag_name' => $tagName, 'description' => $description,