From 2bcba64906bade15ad6fad7a670d48c8a67c5b04 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 29 May 2026 23:49:35 +0100 Subject: [PATCH] fix(release): avoid gh api in beta smoke --- scripts/release-beta-smoke.ts | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/scripts/release-beta-smoke.ts b/scripts/release-beta-smoke.ts index 1ce32f82f78..5be895b4076 100644 --- a/scripts/release-beta-smoke.ts +++ b/scripts/release-beta-smoke.ts @@ -213,7 +213,35 @@ function runParallels(beta: string, model: string): void { } function ghJson(repo: string, pathSuffix: string): unknown { - return JSON.parse(run("gh", ["api", `repos/${repo}/${pathSuffix}`], { capture: true })); + const url = `https://api.github.com/repos/${repo}/${pathSuffix}`; + const result = spawnSync( + "bash", + [ + "-lc", + [ + "set -euo pipefail", + 'token="$(gh auth token)"', + 'curl -fsS -H "Authorization: Bearer ${token}"', + '-H "Accept: application/vnd.github+json"', + '-H "X-GitHub-Api-Version: 2022-11-28"', + '"${OPENCLAW_GITHUB_REST_URL}"', + ].join(" && "), + ], + { + encoding: "utf8", + env: { ...process.env, OPENCLAW_GITHUB_REST_URL: url }, + killSignal: "SIGKILL", + maxBuffer: CAPTURE_MAX_BUFFER_BYTES, + stdio: ["ignore", "pipe", "pipe"], + timeout: DEFAULT_COMMAND_TIMEOUT_MS, + }, + ); + if (result.error || result.status !== 0) { + const reason = result.status ?? result.signal ?? result.error?.message ?? "unknown"; + const stderr = result.stderr ? `\n${result.stderr}` : ""; + throw new Error(`GitHub REST request failed for ${pathSuffix} with ${reason}${stderr}`); + } + return JSON.parse(result.stdout ?? ""); } export function parseWorkflowRunIdFromOutput(output: string): string | undefined {