Add system to the posted comment

This commit is contained in:
Graham Christensen 2017-10-29 17:48:48 -04:00
parent 6a74ae602d
commit d9efa4aa07
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 4 additions and 3 deletions

View file

@ -66,6 +66,7 @@ function runner($msg) {
);
$forward = [
'system' => NIX_SYSTEM,
'payload' => $in,
'output' => $lastlines,
'success' => $pass,

View file

@ -22,14 +22,14 @@ function runner($msg) {
echo "Yikes, $num failede\n";
}
reply_to_issue($in, implode("\n", $body->output), $body->success);
reply_to_issue($in, implode("\n", $body->output), $body->success, $body->system);
var_dump($body->success);
$msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);
}
function reply_to_issue($issue, $output, $success) {
function reply_to_issue($issue, $output, $success, $system) {
$client = gh_client();
$pr = $client->api('pull_request')->show(
$issue->repository->owner->login,
@ -43,7 +43,7 @@ function reply_to_issue($issue, $output, $success) {
$issue->repository->name,
$issue->issue->number,
array(
'body' => "```\n$output\n```",
'body' => "For system: $system\n\n```\n$output\n```",
'event' => $success ? 'APPROVE' : 'COMMENT',
'commit_id' => $sha,
));