Hon*_*iao 11 bash shell github-actions
当我使用setup-minicondashell: bash -l {0}
时,它在 GitHub Actions 中使用:
jobs:\n foo:\n name: Foo\n runs-on: "ubuntu-latest"\n defaults:\n run:\n shell: bash -l {0}\n
Run Code Online (Sandbox Code Playgroud)\n当我使用CML时。它只使用shell: bash
没有-l {0}
.
我在GitHub Actions doc找到了一些解释:
\n\n\n您可以
\nshell
使用 将该值设置为模板字符串command [\xe2\x80\xa6options] {0} [..more_options]
。GitHub 将字符串的第一个空格分隔的单词解释为命令,并在 处插入临时脚本的文件名{0}
。
-l
不过我还是不太明白和 的作用是什么{0}
?对于-l
,它是 的参数bash
吗?
感谢一些解释!
\n这可能与第 128 期有关,其中指出:
我被困了一段时间,因为我的运行命令没有使用登录 bash shell。
所以 conda 环境不活跃。在 yaml 中警告并推荐类似以下内容会很有帮助:
defaults:
run:
shell: bash -l {0}
Run Code Online (Sandbox Code Playgroud)
和:
-l
确保环境设置正确的登录bash;{0}
,一个模板占位符,在管道执行时替换为要执行的实际脚本命令。