From 61c14ea736ab122c8b335bbc36b869e9d27259d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 13 Aug 2024 10:30:55 +0000 Subject: [PATCH 1/2] Allow unauthorized clone --- src/VCS/Adapter/Git/GitHub.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/VCS/Adapter/Git/GitHub.php b/src/VCS/Adapter/Git/GitHub.php index 0b3efab..15ef158 100644 --- a/src/VCS/Adapter/Git/GitHub.php +++ b/src/VCS/Adapter/Git/GitHub.php @@ -516,8 +516,9 @@ public function generateCloneCommand(string $owner, string $repositoryName, stri // URL encode the components for the clone URL $owner = urlencode($owner); $repositoryName = urlencode($repositoryName); - $accessToken = urlencode($this->accessToken); - $cloneUrl = "https://{$owner}:{$accessToken}@github.com/{$owner}/{$repositoryName}"; + $accessToken = !empty($this->accessToken) ? ':' . urlencode($this->accessToken) : ''; + + $cloneUrl = "https://{$owner}{$accessToken}@github.com/{$owner}/{$repositoryName}"; $directory = escapeshellarg($directory); $rootDirectory = escapeshellarg($rootDirectory); From 515e796de71982f485aed6b43753ea9eb80c692b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 13 Aug 2024 10:33:07 +0000 Subject: [PATCH 2/2] FIx tests --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f17f711..32b7b30 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,4 +27,4 @@ jobs: - name: Run Tests run: | - docker-compose exec -T tests vendor/bin/phpunit --configuration phpunit.xml tests \ No newline at end of file + docker compose exec -T tests vendor/bin/phpunit --configuration phpunit.xml tests \ No newline at end of file