diff --git a/src/VCS/Adapter/Git/GitHub.php b/src/VCS/Adapter/Git/GitHub.php index cf795255..f5f3bd67 100644 --- a/src/VCS/Adapter/Git/GitHub.php +++ b/src/VCS/Adapter/Git/GitHub.php @@ -67,8 +67,8 @@ public function initializeVariables(string $installationId, string $privateKey, $this->cache->save($installationId, $tokens); } else { $parsed = \json_decode($response, true); - $this->jwtToken = $parsed['jwtToken']; - $this->accessToken = $parsed['accessToken']; + $this->jwtToken = $parsed['jwtToken'] ?? ''; + $this->accessToken = $parsed['accessToken'] ?? ''; } } @@ -303,7 +303,7 @@ protected function generateAccessToken(string $privateKey, string $githubAppId): $token = $jwt->encode($payload); $this->jwtToken = $token; $res = $this->call(self::METHOD_POST, '/app/installations/' . $this->installationId . '/access_tokens', ['Authorization' => 'Bearer ' . $token]); - $this->accessToken = $res['body']['token']; + $this->accessToken = $res['body']['token'] ?? ''; } /**