From e4cbdde252fdfb2846d7e0733ed3bcb685d32666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 31 Dec 2025 11:04:09 +0100 Subject: [PATCH 1/2] Fix get commit missing details --- src/VCS/Adapter/Git/GitHub.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/VCS/Adapter/Git/GitHub.php b/src/VCS/Adapter/Git/GitHub.php index ad42715..ea200b1 100644 --- a/src/VCS/Adapter/Git/GitHub.php +++ b/src/VCS/Adapter/Git/GitHub.php @@ -494,17 +494,17 @@ public function getCommit(string $owner, string $repositoryName, string $commitH $response = $this->call(self::METHOD_GET, $url, ['Authorization' => "Bearer $this->accessToken"]); - if (!isset($response['body']['commit']['author']['name']) || !isset($response['body']['commit']['message'])) { - throw new Exception("Commit author or message information missing."); - } + $body = $response['body'] ?? []; + $commit = $body['commit'] ?? []; + $author = $commit['author'] ?? []; return [ - 'commitAuthor' => $response['body']['commit']['author']['name'], - 'commitMessage' => $response['body']['commit']['message'], - 'commitAuthorAvatar' => $response['body']['author']['avatar_url'], - 'commitAuthorUrl' => $response['body']['author']['html_url'], - 'commitHash' => $response['body']['sha'], - 'commitUrl' => $response['body']['html_url'], + 'commitAuthor' => $author['name'] ?? 'Unknown', + 'commitMessage' => $commit['message'] ?? 'No message', + 'commitAuthorAvatar' => $author['avatar_url'] ?? '', + 'commitAuthorUrl' => $author['html_url'] ?? '', + 'commitHash' => $body['sha'] ?? '', + 'commitUrl' => $body['html_url'] ?? '', ]; } From 62491de54cfd84536b89c757728769369e7ee78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 31 Dec 2025 11:19:26 +0100 Subject: [PATCH 2/2] Bug fix --- 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 ea200b1..ad5fb9e 100644 --- a/src/VCS/Adapter/Git/GitHub.php +++ b/src/VCS/Adapter/Git/GitHub.php @@ -495,11 +495,12 @@ public function getCommit(string $owner, string $repositoryName, string $commitH $response = $this->call(self::METHOD_GET, $url, ['Authorization' => "Bearer $this->accessToken"]); $body = $response['body'] ?? []; + $author = $body['author'] ?? []; $commit = $body['commit'] ?? []; - $author = $commit['author'] ?? []; + $commitAuthor = $commit['author'] ?? []; return [ - 'commitAuthor' => $author['name'] ?? 'Unknown', + 'commitAuthor' => $commitAuthor['name'] ?? 'Unknown', 'commitMessage' => $commit['message'] ?? 'No message', 'commitAuthorAvatar' => $author['avatar_url'] ?? '', 'commitAuthorUrl' => $author['html_url'] ?? '',