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 `