From cd278ffda8505cd401631135f76829be2d8909f8 Mon Sep 17 00:00:00 2001 From: jkooe <62494645+jkooe@users.noreply.github.com> Date: Wed, 7 Oct 2026 02:14:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=205.1=20=E6=89=A7=E8=A1=8C=E7=9A=84?= =?UTF-8?q?=E5=86=85=E8=81=94=E8=84=9A=E6=9C=AC=E4=B8=80=E5=BE=8B=20ASCII-?= =?UTF-8?q?only=EF=BC=88=E5=90=8C=E4=B8=80=E4=B8=AA=20BOM=20=E5=9D=91?= =?UTF-8?q?=EF=BC=8C=E8=87=A3=E5=9C=A8=20CI=20=E6=AD=A5=E9=AA=A4=E9=87=8C?= =?UTF-8?q?=E5=8E=9F=E6=A0=B7=E5=A4=8D=E7=8E=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第二轮 CI 暴露:『install.ps1 安装链路』失败,报 string is missing the terminator。 根因不是被测脚本(BOM 守卫同轮通过),而是**步骤自身的 run: 块里有中文** —— GitHub 把 run 块写成**无 BOM** 的临时 .ps1,5.1 按 GBK 读 → 中文乱码 → 引号边界崩。 这与 2026-10-04 install.ps1 无 BOM 导致的事故是同一机制,臣在 CI 里原样踩了一遍。 修正: - 所有 shell: powershell(= 5.1)/ shell: cmd 步骤的内联脚本改为 ASCII-only (中文只留在步骤名,那是元数据不参与执行) - BOM 守卫的 throw 消息也一并英文化(它上一轮是侥幸没过炸) - 清理步骤加 continue-on-error,避免前置失败连带掩盖真实结论 保留:shell: pwsh 步骤的英文/中文不受影响(7+ 认 UTF-8 无 BOM)。 --- .github/workflows/windows-e2e.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows-e2e.yml b/.github/workflows/windows-e2e.yml index 420394b..1e5ac45 100644 --- a/.github/workflows/windows-e2e.yml +++ b/.github/workflows/windows-e2e.yml @@ -74,7 +74,7 @@ jobs: foreach ($f in @('scripts\install.ps1', 'scripts\uninstall.ps1', 'scripts\rescue-network.ps1')) { $errs = $null [void][System.Management.Automation.Language.Parser]::ParseFile((Resolve-Path $f).Path, [ref]$null, [ref]$errs) - if ($errs -and $errs.Count -gt 0) { throw ('5.1 解析失败 ' + $f + ' -> ' + $errs[0].Message) } + if ($errs -and $errs.Count -gt 0) { throw ('5.1 parse FAILED: ' + $f + ' -> ' + $errs[0].Message) } Write-Host ('OK 5.1 parse: ' + $f) } @@ -85,17 +85,17 @@ jobs: ./scripts/install.ps1 -Port 18769 -NodeId ci_win $task = Get-ScheduledTask -TaskName "nodeagent" -ErrorAction Stop - Write-Host "计划任务状态: $($task.State)" + Write-Host "Scheduled task state: $($task.State)" $cfg = Get-Content "$env:USERPROFILE\.nodeagent\agent.json" -Raw | ConvertFrom-Json - if ($cfg.port -ne 18769) { throw "端口配置错误: $($cfg.port)" } - if (-not $cfg.key) { throw "预共享密钥缺失" } - if (-not $cfg.tls) { throw "TLS 默认应开启" } + if ($cfg.port -ne 18769) { throw "port mismatch: $($cfg.port)" } + if (-not $cfg.key) { throw "PSK missing in agent.json" } + if (-not $cfg.tls) { throw "TLS should be on by default" } $rule = Get-NetFirewallRule -DisplayName "nodeagent (TCP 18769)" -ErrorAction Stop - if (-not $rule) { throw "防火墙规则未创建" } + if (-not $rule) { throw "Firewall rule" } - Write-Host "OK — 计划任务 / 配置 / 防火墙均已就位" + Write-Host "OK scheduled task / config / firewallall in place" # 一键入口冒烟:真跑 install.cmd / control.cmd。 # 目的不是「再装一遍」,而是证明双击路径可用 —— 这些脚本是用户唯一的