From e4881831951f2a283c0f4cf1b87edd6b67c3697d Mon Sep 17 00:00:00 2001 From: Finesssee <90105158+Finesssee@users.noreply.github.com> Date: Sat, 15 Aug 2026 15:09:14 +0700 Subject: [PATCH] Persist gh PATH at Machine level for cross-step visibility --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a46a5d282..a20ca02fd0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,7 +84,13 @@ jobs: $ghExe = Get-ChildItem -Path $ghDir -Recurse -Filter 'gh.exe' | Select-Object -First 1 if (-not $ghExe) { throw "gh.exe not found after extracting $zipPath" } $env:Path = "$($ghExe.DirectoryName);$env:Path" - [Environment]::SetEnvironmentVariable('Path', $env:Path, 'User') + foreach ($scope in @('Machine', 'User')) { + $scopePath = [Environment]::GetEnvironmentVariable('Path', $scope) + $scopeEntries = @($scopePath -split ';' | Where-Object { $_ }) + if ($scopeEntries -notcontains $ghExe.DirectoryName) { + [Environment]::SetEnvironmentVariable('Path', "$($ghExe.DirectoryName);$scopePath", $scope) + } + } Write-Host "Installed gh at $($ghExe.FullName)" - run: name: Upload matching assets to a draft GitHub Release