From ee0cf0bad6c358a82385910bc81555bfda451ce1 Mon Sep 17 00:00:00 2001 From: Finesssee Date: Sun, 16 Aug 2026 04:59:09 +0700 Subject: [PATCH] fix(publish): define $gh in Invoke-GhUpload Invoke-GhUpload referenced $gh.Source without defining $gh, unlike Invoke-GhJson, Get-Release, and Get-RemoteAssetSha256 which all set $gh = Get-Command gh -ErrorAction Stop. Under Set-StrictMode -Version Latest this threw 'The variable `$gh` cannot be retrieved because it has not been set', failing release-publish at the first asset upload. --- scripts/publish-github-release.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/publish-github-release.ps1 b/scripts/publish-github-release.ps1 index 7f78181898..5c61367afa 100644 --- a/scripts/publish-github-release.ps1 +++ b/scripts/publish-github-release.ps1 @@ -57,6 +57,7 @@ function Invoke-GhJson { function Invoke-GhUpload { param([Parameter(Mandatory)][string]$Path) + $gh = Get-Command gh -ErrorAction Stop $previousErrorActionPreference = $ErrorActionPreference try { $ErrorActionPreference = 'Continue'