diff --git a/build-filter.php b/build-filter.php index 569d321..a8adfa4 100644 --- a/build-filter.php +++ b/build-filter.php @@ -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, ]; diff --git a/builder.php b/builder.php index ffe3766..10f0f7d 100644 --- a/builder.php +++ b/builder.php @@ -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,