Skip to content

fix(publish): define $gh in Invoke-GhUpload - #326

Merged
Finesssee merged 1 commit into
mainfrom
fix-publish-gh-var
Aug 15, 2026
Merged

fix(publish): define $gh in Invoke-GhUpload#326
Finesssee merged 1 commit into
mainfrom
fix-publish-gh-var

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Bug

Invoke-GhUpload in scripts/publish-github-release.ps1 referenced .Source (line 63) without ever defining ``. The three sibling functions all define it:

  • Invoke-GhJson = Get-Command gh -ErrorAction Stop
  • Get-Release = Get-Command gh -ErrorAction Stop
  • Get-RemoteAssetSha256 = Get-Command gh -ErrorAction Stop

Invoke-GhUpload forgot to.

Impact

Under Set-StrictMode -Version Latest (line 21), the publish job throws at the first asset upload:

Invoke-GhUpload : The variable '$gh' cannot be retrieved because it has not been set.

This broke the release-publish CircleCI job for tag v0.49.2.

Fix

Add the missing = Get-Command gh -ErrorAction Stop at the start of Invoke-GhUpload, matching the sibling functions.

Verified: PowerShell parser check passes (PARSE_OK).

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.
@Finesssee
Finesssee merged commit c74c890 into main Aug 15, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant