Add more details to the build job

This commit is contained in:
Graham Christensen 2017-11-06 12:37:59 -05:00
parent cb899fd322
commit da0d9c816e
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 20 additions and 2 deletions

View file

@ -82,8 +82,26 @@ function runner($msg) {
'attrs' => [],
];
} else {
$client = gh_client();
$pr_deets = $client->api('pull_request')->show(
$in->repository->owner->login,
$in->repository->name,
$in->issue->number);
$forward = [
'payload' => $in,
'original_payload' => $in,
'repo' => [
'owner' => $in->repository->owner->login,
'name' => $in->repository->name,
'full_name' => $in->repository->full_name,
'clone_url' => $in->repository->clone_url,
],
'pr' => [
'number' => $in->issue->number,
'target_branch' => $pr_deets['base']['ref'],
'patch_url' => $pr_deets['patch_url'],
'head_sha' => $pr_deets['head']['sha'],
],
'build_default' => false,
'attrs' => $tokens,
];

View file

@ -23,7 +23,7 @@ $queueName = 'build-inputs-' . NIX_SYSTEM;
function runner($msg) {
echo "got a job!\n";
$body = json_decode($msg->body);
$in = $body->payload;
$in = $body->original_payload;
$co = new GHE\Checkout(WORKING_DIR, "builder");
$pname = $co->checkOutRef($in->repository->full_name,