From 8ce067c62d1941736d96ca5f38d7cb91a9a9b713 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:16:25 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20=E4=BF=AE=E5=A4=8Dtoken=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E9=97=AE=E9=A2=98=EF=BC=9A=E4=BD=BF=E7=94=A8=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E4=BC=A0=E9=80=92=E8=80=8C=E9=9D=9E?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=8B=BC=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/26567be5-dda9-4678-ae0d-e8a021dbde78 --- .../guanghu-zhizhi/scripts/persona-checkin.js | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/spoke-deployments/guanghu-zhizhi/scripts/persona-checkin.js b/spoke-deployments/guanghu-zhizhi/scripts/persona-checkin.js index 0947cf8b..1523722a 100644 --- a/spoke-deployments/guanghu-zhizhi/scripts/persona-checkin.js +++ b/spoke-deployments/guanghu-zhizhi/scripts/persona-checkin.js @@ -79,8 +79,9 @@ const hubToken = process.env.HUB_TOKEN; if (hubToken) { try { const start = Date.now(); - execSync('curl -sf -H "Authorization: token ' + hubToken + '" https://api.github.com/repos/qinfendebingshuo/guanghulab -o /dev/null', { - timeout: 15000 + execSync('curl -sf -H "Authorization: token $HUB_TOKEN" https://api.github.com/repos/qinfendebingshuo/guanghulab -o /dev/null', { + timeout: 15000, + env: Object.assign({}, process.env, { HUB_TOKEN: hubToken }) }); const latency = Date.now() - start; results.checks.push({ @@ -97,18 +98,25 @@ if (hubToken) { } // ⑥ 铸渊连接状态(副控专属) -try { - const start = Date.now(); - execSync(`curl -sf -H "Authorization: token ${hubToken}" https://api.github.com/repos/qinfendebingshuo/guanghulab/dispatches -X POST -d '{"event_type":"ping"}' -o /dev/null 2>/dev/null || true`); - const latency = Date.now() - start; - results.checks.push({ - name: '铸渊连接', - icon: '⚒️', - status: latency < 5000 ? 'ok' : 'warn', - detail: `指令通道可达 · 延迟 ${latency}ms` - }); -} catch { - results.checks.push({ name: '铸渊连接', icon: '⚒️', status: 'error', detail: '指令通道不可达 → 检查Token' }); +if (hubToken) { + try { + const start = Date.now(); + execSync('curl -sf -H "Authorization: token $HUB_TOKEN" https://api.github.com/repos/qinfendebingshuo/guanghulab/dispatches -X POST -d \'{"event_type":"ping"}\' -o /dev/null 2>/dev/null || true', { + timeout: 15000, + env: Object.assign({}, process.env, { HUB_TOKEN: hubToken }) + }); + const latency = Date.now() - start; + results.checks.push({ + name: '铸渊连接', + icon: '⚒️', + status: latency < 5000 ? 'ok' : 'warn', + detail: '指令通道可达 · 延迟 ' + latency + 'ms' + }); + } catch { + results.checks.push({ name: '铸渊连接', icon: '⚒️', status: 'error', detail: '指令通道不可达 → 检查Token' }); + } +} else { + results.checks.push({ name: '铸渊连接', icon: '⚒️', status: 'error', detail: 'HUB_TOKEN 未配置 → 铸渊连接不可用' }); } // 写入签到结果