Mar*_*rco 11 github github-actions
是否可以使用 GitHub Actions 表达式有条件地连接字符串?
例如,就像我在下面的示例中尝试做的那样。
- name: Release
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist ${{ if (startsWith(github.ref, 'refs/tags/')) { '--snapshot' }}
Run Code Online (Sandbox Code Playgroud)
Ber*_*tel 13
您可以使用以下内容,-additional-arg
如果满足条件则返回,否则返回空字符串:
${{ (startsWith(github.ref, 'refs/tags/') && '-additional-arg') || '' }}
Run Code Online (Sandbox Code Playgroud)
例子:
${{ (startsWith(github.ref, 'refs/tags/') && '-additional-arg') || '' }}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4402 次 |
最近记录: |