Skip to content

Commit e8e3286

Browse files
authored
Merge pull request #37 from utopia-php/feat-commit-details-0.8.x
Feat: Improve commit details
2 parents 18abc35 + 1554539 commit e8e3286

File tree

3 files changed

+48
-55
lines changed

3 files changed

+48
-55
lines changed

composer.lock

Lines changed: 42 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VCS/Adapter/Git/GitHub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ public function getCommit(string $owner, string $repositoryName, string $commitH
453453
'commitAuthor' => $response['body']['commit']['author']['name'],
454454
'commitMessage' => $response['body']['commit']['message'],
455455
'commitAuthorAvatar' => $response['body']['author']['avatar_url'],
456+
'commitHash' => $response['body']['sha'],
457+
'commitUrl' => $response['body']['html_url'],
456458
];
457459
}
458460

tests/VCS/Adapter/GitHubTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ public function testGetCommit(): void
326326
$commitDetails = $this->vcsAdapter->getCommit('test-kh', 'test1', '7ae65094d56edafc48596ffbb77950e741e56412');
327327
$this->assertIsArray($commitDetails);
328328
$this->assertEquals('https://avatars.githubusercontent.com/u/43381712?v=4', $commitDetails['commitAuthorAvatar']);
329+
$this->assertEquals('Khushboo Verma', $commitDetails['commitAuthor']);
330+
$this->assertEquals('Initial commit', $commitDetails['commitMessage']);
331+
$this->assertEquals('https://github.com/test-kh/test1/commit/7ae65094d56edafc48596ffbb77950e741e56412', $commitDetails['commitUrl']);
332+
$this->assertEquals('7ae65094d56edafc48596ffbb77950e741e56412', $commitDetails['commitHash']);
329333
}
330334

331335
public function testGetLatestCommit(): void

0 commit comments

Comments
 (0)