Pass environment variables from step description into a shell step #4
-
Is it possible to pass the env variables from step description into shell "wsl-bash" step? I tried and it failed, but maybe I did something sloppy. Another question: is it possible to specify working directory as a property of the shell step? Two common choices are: case-insensitive mount such as Example of my workflow: https://github.com/vadimkantorov/perlwslv1buildtest/blob/master/.github/workflows/build.yml |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Two details about the example you showed.
Regarding environment variables, the environment variables you set, are set in Windows. Almost none of the Windows environment variables are forwarded to WSL. You need to explicitly specify in a separate environment variable which environment variables to forward to WSL and how to convert them (like paths or path lists) like shown for example at https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/. Regarding working directory, you can define the working directory of a run step as input, I think that should also be the working directory inside WSL then, but I'm not fully sure about that. I'm not sure what you mean with the case sensitive and insensitive part and to choose what. Can you elaborate on that, maybe with an example? |
Beta Was this translation helpful? Give feedback.
-
Regarding your questions here also a little demo workflow run: https://github.com/Vampire/setup-wsl/runs/1469130942?check_suite_focus=true Regarding the directories, I verified that you are in the exact directory within WSL where you are outside, so setting the Maybe you misinterpret that Windows environment and WSL environment are two completely separate things. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your help! I improved my workflow with |
Beta Was this translation helpful? Give feedback.
Regarding your questions here also a little demo workflow run: https://github.com/Vampire/setup-wsl/runs/1469130942?check_suite_focus=true
Regarding the directories, I verified that you are in the exact directory within WSL where you are outside, so setting the
working-directory
input works as expected.Maybe you misinterpret that Windows environment and WSL environment are two completely separate things.
The user home directory on Windows is the home directory of the Windows user, which is usually found at
c:\Users\<user>\
and thus mounted in WSL at/mnt/c/Users/<user>/
.The directory
/home/foo
in WSL is usually the home directory of the userfoo
wihin the Linux distribution which is com…