我已按照作业和条件工作流中的条件步骤中描述的指南,并为我的 CircleCI 管道编写了以下代码。
version: 2.1
workflows:
version: 2.1
workflowone:
when:
condition: false
jobs:
- samplejob:
workflowtwo:
when:
condition: true
jobs:
- jobone
jobs:
samplejob:
docker:
- image: buildpack-deps:stable
steps:
- run:
name: Sample Job in WF 1
command: |
echo "This job is in workflowone and the workflow should not run"
jobone:
docker:
- image: buildpack-deps:stable
steps:
- run:
name: Sample Job in WF 2
command: |
echo "This job is in workflowtwo and the workflow should run"
当我运行上面的代码时,输出不是预期的。第一个工作流不应运行,因为条件为假。当管道触发时,两个工作流都开始运行。谁能指出这里缺少的部分?