cli / gh-extension-precompile

Action for publishing binary GitHub CLI extensions
MIT License
93 stars 41 forks source link

Update action path to work on windows #32

Closed speedyleion closed 1 year ago

speedyleion commented 1 year ago

Previously the path to the action script was ${{ github.action_path }} which uses the native path format. On Windows machines this ends up passing paths with \ to bash, which bash tries to interpret as escape characters. "c:\a\b" would get interpreted as "c:ab".

Now the path replaces all instances of \ with / to work with bash on Windows. This assumes that \ would never be used on other github runners.

Solution was copied from https://github.com/actions/runner/issues/1066

speedyleion commented 1 year ago

This run, https://github.com/speedyleion/gh-difftool/actions/runs/4033773125 resulted in the following when running on a windows runner

Run D:\a\_actions\cli\gh-extension-precompile\v1/build_and_release.sh
D:\a\_temp\30533e1b-ddc7-4866-bdca-4b174a20c926.sh: line 1: D:a_actionscligh-extension-precompilev1/build_and_release.sh: No such file or directory
Error: Process completed with exit code 127.

This run https://github.com/speedyleion/gh-difftool/actions/runs/4035182759 used my fork and branch to succeed on windows