GitHub动作中的嵌套环境变量
我正在使用github操作,并尝试使用$用户系统环境变量创建路径的环境变量。
这是我的YML文件:
env:
MY_PATH: "/Users/$USER/myDir/"
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- name: echo path
run: echo "$MY_PATH"
打印的内容是:
/Users/$USER/myDir/
预期的是:
/Users/MyUserName/myDir/
有没有办法使用$ user,$ home等。在脚本将它们扩展到其持有的文本的方式上?
I'm using github actions and trying to create an environmental variable of a path using the $USER system environmental variable.
This is my yml file:
env:
MY_PATH: "/Users/$USER/myDir/"
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- name: echo path
run: echo "$MY_PATH"
What is printed is:
/Users/$USER/myDir/
The expected was:
/Users/MyUserName/myDir/
Is there a way to make use of the $USER, $HOME etc. in a way that the script will expand them to the text they hold?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论