お知らせ:

当社は、お客様により充実したサポート情報を迅速に提供するため、本ページのコンテンツは機械翻訳を用いて日本語に翻訳しています。正確かつ最新のサポート情報をご覧いただくには、本内容の英語版を参照してください。

条件(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