diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b8e481..6756237e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [11.11.1] - 2023-10-08 + +* Fixed double encoding of job name in artifacts download + ## [11.11.0] - 2023-07-17 * Add support for `author_id` in `Issues::all` diff --git a/README.md b/README.md index afdf50e8..1e120fe5 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ $ composer require "m4tthumphrey/php-gitlab-api:^11.11" \ #### Laravel: ```bash -$ composer require "graham-campbell/gitlab:^7.3" +$ composer require "graham-campbell/gitlab:^7.2" ``` #### Symfony: diff --git a/src/Api/Jobs.php b/src/Api/Jobs.php index 70d7a28f..bd318f89 100644 --- a/src/Api/Jobs.php +++ b/src/Api/Jobs.php @@ -151,7 +151,7 @@ public function artifacts($project_id, int $job_id) public function artifactsByRefName($project_id, string $ref_name, string $job_name) { return $this->getAsResponse('projects/'.self::encodePath($project_id).'/jobs/artifacts/'.self::encodePath($ref_name).'/download', [ - 'job' => self::encodePath($job_name), + 'job' => $job_name, ])->getBody(); } @@ -166,7 +166,7 @@ public function artifactsByRefName($project_id, string $ref_name, string $job_na public function artifactByRefName($project_id, string $ref_name, string $job_name, string $artifact_path) { return $this->getAsResponse('projects/'.self::encodePath($project_id).'/jobs/artifacts/'.self::encodePath($ref_name).'/raw/'.self::encodePath($artifact_path), [ - 'job' => self::encodePath($job_name), + 'job' => $job_name, ])->getBody(); } diff --git a/tests/Api/JobsTest.php b/tests/Api/JobsTest.php index 307acf1f..9ca55526 100644 --- a/tests/Api/JobsTest.php +++ b/tests/Api/JobsTest.php @@ -171,12 +171,12 @@ public function shouldGetArtifactsByRefName(): void $api->expects($this->once()) ->method('getAsResponse') ->with('projects/1/jobs/artifacts/master/download', [ - 'job' => 'job_name', + 'job' => 'job name', ]) ->will($this->returnValue($returnedStream)) ; - $this->assertEquals('foobar', $api->artifactsByRefName(1, 'master', 'job_name')->getContents()); + $this->assertEquals('foobar', $api->artifactsByRefName(1, 'master', 'job name')->getContents()); } /** @@ -189,11 +189,11 @@ public function shouldGetArtifactByRefName(): void $api->expects($this->once()) ->method('getAsResponse') ->with('projects/1/jobs/artifacts/master/raw/artifact_path', [ - 'job' => 'job_name', + 'job' => 'job name', ]) ->will($this->returnValue($returnedStream)) ; - $this->assertEquals('foobar', $api->artifactByRefName(1, 'master', 'job_name', 'artifact_path')->getContents()); + $this->assertEquals('foobar', $api->artifactByRefName(1, 'master', 'job name', 'artifact_path')->getContents()); } /**