Conversation
|
Can you give an example for what it's needed? Do you know you can call |
|
I've been playing around with a fork of this action that installs the last i686 msys release, and a workflow to build the packages I've missed out on since i686 stopped getting updated (it's actually been going surprisingly well). I wanted to call autorebase.bat after updating the packages I'd already built, so needed to know the path from a cmd run step. It didn't occur to me to call out to cygpath, but I had seen the docs that steps could output variables and thought that made enough sense to offer that change upstream. |
|
ok, thanks. That seems like a very uncommon use case, though I'm not against it per se, except maybe the naming. @eine any thoughts? |
|
For reference, using cygpath instead of an output variable: - name: test output
shell: cmd
run: |
set MSYSTEM=MSYS
FOR /F "tokens=* USEBACKQ" %%g IN (`CALL msys2 -c 'cygpath -w /'`) DO (SET "MSYSROOT=%%g")
echo %MSYSROOT%
call "%MSYSROOT%\autorebase.bat" |
|
Untested, but something like this should also work in powershell: Invoke-Expression (msys2 -c 'cygpath -m /autorebase.bat') |
|
Honestly, I don't like the feature to set outputs from Actions. It feels like a not very well thought ad-hoc solution. Instead, I'd use some more natural solution, such as setting an environment variable: https://github.com/actions/toolkit/tree/main/packages/core#exporting-variables. However, if the last comment by @lazka works, maybe it's better to just document that in the README. On the other hand, I believe that |
|
To better match what I was doing, I tested the following: & (Join-Path (msys2 -c 'cygpath -w /') 'autorebase.bat')and confirmed that that works. I'm sure giving autorebase.bat to cygpath instead of using Join-Path would also work. |
|
And if you really want an output for some reason, you can set one from a run step: - name: test cygpath
id: cygpath
run: |
$env:MSYSTEM = 'MSYS'
Write-Output ('::set-output name=msysRootDir::{0}' -f (msys2 -c 'cygpath -w /'))
- name: autorebase
run: |
$env:MSYSTEM = 'MSYS'
& (Join-Path '${{ steps.cygpath.outputs.msysRootDir }}' 'autorebase.bat') |
|
for anyone like me wanted it in environment variable: |
It's reasonable that another step might want to know this.
Calling autorebase.bat seemed a good way to test this, even though it shouldn't be needed on x86_64