$commit, 'ref' => $payload['ref'], 'received_at' => gmdate(DATE_ATOM)], JSON_THROW_ON_ERROR); if (file_put_contents($temporary, $data) === false || ! rename($temporary, $file)) { @unlink($temporary); http_response_code(503); exit('Queue unavailable'); } // systemd.path observes the queue even if a previous build is still active. http_response_code(202); header('Content-Type: application/json'); echo json_encode(['accepted' => true, 'commit' => $commit]);