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

Windows support: Handle when Expand-Archive refuses to extract file without .zip extension #166

Closed

Conversation

cpc-camarj
Copy link

This is a workaround to handle the problem described here: actions/toolkit#1287

@bendrucker
Copy link
Member

Windows tests that reproduce this issue would be ideal! I can work on testing on Windows if needed.

@bendrucker
Copy link
Member

See #168. I read actions/toolkit#1287 more carefully. I'm disinclined to add a workaround here for @actions/* for a specific Windows self-hosted runner configuration. Especially for outdated versions. I don't know much about PowerShell but perhaps it would be possible to shim that command to do the renaming you want.

@cpc-camarj
Copy link
Author

I looked into shimming, and it would be possible to workaround this problem with something like the following in a Powershell profile:

function Expand-Archive($path) { 
  if ( $path -NotMatch ".zip$" ){ 
    Move-Item "$path" "${path}.zip"
    powershell.exe -nop -c Expand-Archive "${path}.zip"
  } else {
    powershell -nop -c Expand-Archive $path
  }
}

we ultimately decided to go ahead and install Powershell Core by default on all our self-hosted runners.

@cpc-camarj
Copy link
Author

since my team has landed on a different solution, I'll close the PR.

@cpc-camarj cpc-camarj closed this Jun 2, 2023
@cpc-camarj cpc-camarj deleted the windows-support branch June 2, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants