github action 并发中是否可以添加 IF 条件?
我想要执行以下操作,但仅当分支名称不是时master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
Run Code Online (Sandbox Code Playgroud)
我的yaml文件上的触发器如下:
name: Build
on:
push:
Run Code Online (Sandbox Code Playgroud)
这会在任何分支(主分支或功能分支)上推送时触发
您可以按原样保留并发组名称,并且仅当分支名称不是以下名称时才取消正在进行的任务master
:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
Run Code Online (Sandbox Code Playgroud)
要了解更多信息:
!=
,请参阅:https ://docs.github.com/en/actions/learn-github-actions/expressions#operatorstrue
或false
从表达式),请参阅:https ://docs.github.com/en/actions/learn-github-actions/expressions#literalsgithub
,请参阅:https ://docs.github.com/en/actions/learn-github-actions/contexts#example-contents-of-the-github-context 归档时间: |
|
查看次数: |
996 次 |
最近记录: |