条件(When)
when conditionは、pipelineの実行フローを定義するために設定できる基本的なロジックです。when conditionは、stageレベル、jobレベル、またはpipelineレベルで定義できます。when conditionはこれらのいずれのレベルでも適用でき、コンポーネントの順序は重要ではないことに注意してください。
when conditionとともに以下の演算子を使用できます:
when-equal
copy
when:
equal:
- << status.build.package >>
- success
when-not-equal
when-not-equal
copy
not-equal:
- << status.build.package >>
- failed
when-not
copy
when:
-not:true
when-and/when-or
copy
when:
or:
- and:
- equal:
- << pipeline.status.build >>
- success
- not-equal:
- << pipeline.status.build.hello-world >>
- failed
- equal:
- << pipeline.event.{{Event Variable Placeholder}} >>
注意: approval jobsにはwhen conditionsを設定できません。
グローバル設定
必要に応じて、pipelineレベルでwhen conditionを定義できます。この条件はpipelineの実行フローのみを決定します。以下のように条件を設定できます:
copy
pipeline-when:
equal:
- << event.ref >>
- refs/heads/main
最終更新日 2026-02-23 18:09:41 +0530 IST
Yes
No
Send your feedback to us
Skip
Submit