From d1267add81ebb813b502815e1d5c9e6847556d0e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Apr 2026 15:28:01 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=87=E7=BA=B3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=AE=A1=E6=9F=A5=E5=8F=8D=E9=A6=88=20=E2=80=94=20SSH=20config?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=8F=92=E5=80=BC=E3=80=81=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=A3=80=E6=9F=A5=E3=80=81=E5=AF=86=E9=92=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/bf92e1d8-e789-468b-80ab-2d7fec9be6c2 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/deploy-cn-llm-relay.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-cn-llm-relay.yml b/.github/workflows/deploy-cn-llm-relay.yml index 3033662f..4d95cd62 100644 --- a/.github/workflows/deploy-cn-llm-relay.yml +++ b/.github/workflows/deploy-cn-llm-relay.yml @@ -62,11 +62,14 @@ jobs: fi # 显示密钥指纹用于调试(不泄露私钥内容) - ssh-keygen -l -f ~/.ssh/cn_key && echo "✅ 密钥指纹读取成功" || echo "⚠️ 无法读取密钥指纹" + ssh-keygen -l -f ~/.ssh/cn_key && echo "✅ 密钥指纹读取成功" || echo "⚠️ 无法读取密钥指纹 — 密钥可能格式异常,请检查 ZY_CN_LLM_KEY 或重新生成密钥对" # 写入 SSH config · 统一连接参数 - cat > ~/.ssh/config << 'SSHCONF' + # 使用 heredoc 直接插值 Host/User(secrets 由 GitHub Actions 运行时注入,不会出现在日志中) + cat > ~/.ssh/config << SSHCONF Host cn-relay + HostName ${{ secrets.ZY_CN_LLM_HOST }} + User ${{ secrets.ZY_CN_LLM_USER }} StrictHostKeyChecking accept-new UserKnownHostsFile ~/.ssh/known_hosts IdentityFile ~/.ssh/cn_key @@ -75,9 +78,6 @@ jobs: ServerAliveCountMax 3 ConnectTimeout 30 SSHCONF - # 注入实际 Host/User(避免 heredoc 内插值泄露) - sed -i "1a\\ HostName ${{ secrets.ZY_CN_LLM_HOST }}" ~/.ssh/config - sed -i "2a\\ User ${{ secrets.ZY_CN_LLM_USER }}" ~/.ssh/config chmod 600 ~/.ssh/config # 扫描主机公钥(不静默·便于排查) @@ -91,7 +91,7 @@ jobs: ssh -vvv -o BatchMode=yes -o ConnectTimeout=15 \ -i ~/.ssh/cn_key \ ${{ secrets.ZY_CN_LLM_USER }}@${{ secrets.ZY_CN_LLM_HOST }} \ - "echo '✅ SSH连接成功 · $(hostname) · $(date)'" \ + "echo '✅ SSH连接成功 · $(hostname) · $(date)' && test -d /opt/cn-llm-relay && echo '✅ 部署目录存在' || echo '⚠️ /opt/cn-llm-relay 不存在·首次部署将自动创建'" \ 2>&1 || { echo "" echo "═══ SSH连接失败 · 排查方向 ═══"