From e6c3613340e1ad60eb883584b6878776d8d03326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E4=BD=93=E8=BF=90=E8=BD=AC?= <30560683+534A4D21@users.noreply.github.com> Date: Fri, 31 Jul 2026 09:08:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20fork=20PR=20?= =?UTF-8?q?=E7=9A=84=20Windows=20bootstrap=20=E5=8F=96=E6=BA=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31a4c9c..6b3a526 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,6 +93,9 @@ jobs: - name: Run locked in-place upgrade smoke test shell: pwsh + env: + SOURCE_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + SOURCE_BRANCH: ${{ github.head_ref || github.ref_name }} run: | $installDir = "$env:TEMP\cx-codex-smoke-install" $distCliDir = Join-Path $installDir "dist-cli" @@ -121,14 +124,22 @@ jobs: if (-not $listener -or [int]$listener.OwningProcess -ne $lockProcess.Id) { throw "Upgrade fixture did not acquire the expected listener and PID marker." } - $branch = if ($env:GITHUB_HEAD_REF) { $env:GITHUB_HEAD_REF } else { $env:GITHUB_REF_NAME } + if ($env:SOURCE_REPOSITORY -notmatch '^[^/]+/[^/]+$') { + throw "Source repository must use the owner/name format." + } + if ([string]::IsNullOrWhiteSpace($env:SOURCE_BRANCH)) { + throw "Source branch must not be empty." + } + $repoOwner, $repoName = $env:SOURCE_REPOSITORY -split '/', 2 $jsonLines = @( ./scripts/bootstrap-windows.ps1 ` -InstallDir $installDir ` -WorkspacePath "$env:TEMP\CodexWorkspace" ` -Port 7441 ` -Password "ci-password" ` - -Branch $branch ` + -RepoOwner $repoOwner ` + -RepoName $repoName ` + -Branch $env:SOURCE_BRANCH ` -UseBranchArchive ` -SkipStartupTask ` -SkipWatchdogTask `