'Invalid signature']); exit; } $data = json_decode($payload, true); $ref = $data['ref'] ?? ''; $pusher = $data['pusher']['name'] ?? 'unknown'; if ($ref !== 'refs/heads/main') { echo json_encode(['ok' => true, 'skipped' => "ref $ref is not main"]); exit; } $ts = date('Y-m-d H:i:s'); file_put_contents(DEPLOY_QUEUE, REPO_PATH . "\n", FILE_APPEND | LOCK_EX); file_put_contents(DEPLOY_LOG, "[$ts] Queued deploy by $pusher\n", FILE_APPEND | LOCK_EX); echo json_encode(['ok' => true, 'queued' => 'web-dashboard']);