Skip to content

Commit f635b36

Browse files
Merge pull request #43 from utopia-php/fix-use-html_url-instead-of-url
Use html_url in push events
2 parents a51ca92 + 2d5a4f4 commit f635b36

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/VCS/Adapter/Git/GitHub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,8 @@ public function getEvent(string $event, string $payload): array
591591
$repositoryId = strval($payload['repository']['id'] ?? '');
592592
$repositoryName = $payload['repository']['name'] ?? '';
593593
$branch = str_replace('refs/heads/', '', $ref);
594-
$branchUrl = $payload['repository']['url'] . "/tree/" . $branch;
595-
$repositoryUrl = $payload['repository']['url'];
594+
$branchUrl = $payload['repository']['html_url'] . "/tree/" . $branch;
595+
$repositoryUrl = $payload['repository']['html_url'];
596596
$commitHash = $payload['after'] ?? '';
597597
$owner = $payload['repository']['owner']['name'] ?? '';
598598
$authorUrl = $payload['sender']['html_url'];

tests/VCS/Adapter/GitHubTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testgetEvent(): void
3838
"name": "testing-fork",
3939
"full_name": "vermakhushboo/testing-fork",
4040
"private": true,
41-
"url": "https://github.com/vermakhushboo/g4-node-function",
41+
"html_url": "https://github.com/vermakhushboo/g4-node-function",
4242
"owner": {
4343
"name": "vermakhushboo"
4444
}

0 commit comments

Comments
 (0)