diff --git a/composer.lock b/composer.lock index b0d3649..54adf08 100644 --- a/composer.lock +++ b/composer.lock @@ -302,16 +302,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -350,7 +350,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -358,7 +358,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", @@ -2040,5 +2040,5 @@ "php": ">=8.0" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/src/VCS/Adapter/Git/GitHub.php b/src/VCS/Adapter/Git/GitHub.php index 15ef158..0edf869 100644 --- a/src/VCS/Adapter/Git/GitHub.php +++ b/src/VCS/Adapter/Git/GitHub.php @@ -582,6 +582,7 @@ public function getEvent(string $event, string $payload): array $commitHash = $payload['after'] ?? ''; $owner = $payload['repository']['owner']['name'] ?? ''; $authorUrl = $payload['sender']['html_url']; + $authorAvatarUrl = $payload['sender']['avatar_url'] ?? ''; $headCommitAuthor = $payload['head_commit']['author']['name'] ?? ''; $headCommitMessage = $payload['head_commit']['message'] ?? ''; $headCommitUrl = $payload['head_commit']['url'] ?? ''; @@ -598,6 +599,7 @@ public function getEvent(string $event, string $payload): array 'owner' => $owner, 'authorUrl' => $authorUrl, 'headCommitAuthor' => $headCommitAuthor, + 'authorAvatarUrl' => $authorAvatarUrl, 'headCommitMessage' => $headCommitMessage, 'headCommitUrl' => $headCommitUrl, 'external' => false, @@ -615,6 +617,7 @@ public function getEvent(string $event, string $payload): array $owner = $payload['repository']['owner']['login'] ?? ''; $authorUrl = $payload['sender']['html_url']; $commitHash = $payload['pull_request']['head']['sha'] ?? ''; + $authorAvatarUrl = $payload['pull_request']['user']['avatar_url'] ?? ''; $headCommitUrl = $repositoryUrl . "/commits/" . $commitHash; $external = $payload['pull_request']['head']['user']['login'] !== $payload['pull_request']['base']['user']['login']; @@ -629,6 +632,7 @@ public function getEvent(string $event, string $payload): array 'owner' => $owner, 'authorUrl' => $authorUrl, 'headCommitUrl' => $headCommitUrl, + 'authorAvatarUrl' => $authorAvatarUrl, 'external' => $external, 'pullRequestNumber' => $pullRequestNumber, 'action' => $action, diff --git a/tests/VCS/Adapter/GitHubTest.php b/tests/VCS/Adapter/GitHubTest.php index 9e8b4c9..3116aa3 100644 --- a/tests/VCS/Adapter/GitHubTest.php +++ b/tests/VCS/Adapter/GitHubTest.php @@ -54,7 +54,8 @@ public function testgetEvent(): void "url": "https://github.com/vermakhushboo/g4-node-function/commit/b787f03343171ff5a477627796140bfa1d02da09" }, "sender": { - "html_url": "https://github.com/vermakhushboo" + "html_url": "https://github.com/vermakhushboo", + "avatar_url": "https://avatars.githubusercontent.com/u/43381712?v=4" } }'; @@ -78,6 +79,10 @@ public function testgetEvent(): void "user": { "login": "vermakhushboo" } + }, + "user" : { + "login": "vermakhushboo", + "avatar_url": "https://avatars.githubusercontent.com/u/43381712?v=4" } }, "repository": {