Skip to content

Commit

Permalink
Merge pull request #24 from utopia-php/fix-unauthorized-clone
Browse files Browse the repository at this point in the history
Fix: Unahtorized clone
  • Loading branch information
christyjacob4 authored Aug 13, 2024
2 parents 3084aa9 + 515e796 commit eb9b7ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Run Tests
run: |
docker-compose exec -T tests vendor/bin/phpunit --configuration phpunit.xml tests
docker compose exec -T tests vendor/bin/phpunit --configuration phpunit.xml tests
5 changes: 3 additions & 2 deletions src/VCS/Adapter/Git/GitHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eb9b7ea

Please sign in to comment.