Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install GH CLI in Windows #170

Open
esdandreu opened this issue Mar 5, 2025 · 1 comment
Open

Can't install GH CLI in Windows #170

esdandreu opened this issue Mar 5, 2025 · 1 comment

Comments

@esdandreu
Copy link

esdandreu commented Mar 5, 2025

This action attempts to download the gh CLI from https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_win32_amd64.zip but the CLI for window is not released with that name. This is a valid download URL: https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_windows_amd64.zip.

The problem is that GH CLI releases Windows binaries where the platform tag is not win32 but windows.

Example failed workflow

Run ksivamuthu/actions-setup-gh-cli@v3
  with:
    version: 2.67.0
    archive_format: zip
Installing gh cli in self hosted runner
Downloading gh cli from https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_win32_amd64.zip
Error: Unexpected HTTP response: 404

P.S. I really like this project. Simple and effective. If you agree I can send a PR to fix this issue.

@esdandreu esdandreu changed the title Can't install GH CLI in windows Can't install GH CLI in Windows Mar 5, 2025
@esdandreu
Copy link
Author

esdandreu commented Mar 5, 2025

There is a workaround by specifying the undocumented input platform:

- name: Install the gh cli
  uses: ksivamuthu/actions-setup-gh-cli@v3
  with:
    version: 2.67.0
    archive_format: zip
    platform: windows

But then extractZip fails to extract the file.

 Warning: Unexpected input(s) 'platform', valid inputs are ['version', 'archive_format']
Run ksivamuthu/actions-setup-gh-cli@v3
  with:
    version: 2.67.0
    archive_format: zip
    platform: windows
Installing gh cli in self hosted runner
Downloading gh cli from https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_windows_amd64.zip
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'gh_tar' -DestinationPath 'C:\actions-runner\_work\_temp\c8299e53-f6e3-4393-8af7-8673958f8315' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('gh_tar', 'C:\actions-runner\_work\_temp\c8299e53-f6e3-4393-8af7-8673958f8315', $true) }"
Expand-Archive :  is not a supported archive file format. .zip is the only supported archive file format.
At line:1 char:210
+ ...  Ignore)) { Expand-Archive -LiteralPath 'gh_tar' -DestinationPath 'C: ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:String) [Expand-Archive], IOException
    + FullyQualifiedErrorId : NotSupportedArchiveFileExtension,Expand-Archive

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

No branches or pull requests

1 participant