Skip to content

Commit 7de3f13

Browse files
committed
feat: add annotations and images params to createCheckRun output
1 parent d733ddf commit 7de3f13

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/VCS/Adapter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ abstract public function updateCommitStatus(string $repositoryName, string $SHA,
240240
* status can be one of: queued, in_progress, completed
241241
* conclusion (required when status=completed) can be one of: action_required, cancelled, failure, neutral, success, skipped, timed_out
242242
*
243+
* @param array<mixed> $annotations
244+
* @param array<mixed> $images
243245
* @return array<mixed>
244246
*/
245247
public function createCheckRun(
@@ -252,6 +254,8 @@ public function createCheckRun(
252254
string $title = '',
253255
string $summary = '',
254256
string $text = '',
257+
array $annotations = [],
258+
array $images = [],
255259
string $detailsUrl = '',
256260
string $externalId = '',
257261
string $startedAt = '',

src/VCS/Adapter/Git/GitHub.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,10 @@ public function updateCommitStatus(string $repositoryName, string $commitHash, s
879879
*
880880
* @return array<mixed>
881881
*/
882+
/**
883+
* @param array<mixed> $annotations
884+
* @param array<mixed> $images
885+
*/
882886
public function createCheckRun(
883887
string $owner,
884888
string $repositoryName,
@@ -889,6 +893,8 @@ public function createCheckRun(
889893
string $title = '',
890894
string $summary = '',
891895
string $text = '',
896+
array $annotations = [],
897+
array $images = [],
892898
string $detailsUrl = '',
893899
string $externalId = '',
894900
string $startedAt = '',
@@ -912,11 +918,20 @@ public function createCheckRun(
912918
);
913919

914920
if (!empty($title) || !empty($summary)) {
915-
$body['output'] = array_filter([
921+
$output = array_filter([
916922
'title' => $title,
917923
'summary' => $summary,
918924
'text' => $text,
919925
], fn ($value) => !empty($value));
926+
927+
if (!empty($annotations)) {
928+
$output['annotations'] = $annotations;
929+
}
930+
if (!empty($images)) {
931+
$output['images'] = $images;
932+
}
933+
934+
$body['output'] = $output;
920935
}
921936

922937
$response = $this->call(self::METHOD_POST, $url, ['Authorization' => "Bearer $this->accessToken"], $body);

0 commit comments

Comments
 (0)