--- title: "条件(When)" url: https://docs.catalyst.zoho.com/ja/pipelines/help/catalyst-pipelines.yaml/build-the-pipeline/when-condition/ description: "Catalyst Pipelinesのconditionsの詳細、関連するキーワード、およびサンプルコードスニペットについて学びます。" last_updated: 2026-02-23T12:39:41Z service: Pipelines type: general related_links: - name: "パイプラインの設定" url: /ja/pipelines/help/catalyst-pipelines.yaml/implementation --- # 条件(When) # はじめに when conditionは、pipelineの実行フローを定義するために設定できる基本的なロジックです。when conditionは、stageレベル、jobレベル、またはpipelineレベルで定義できます。when conditionはこれらのいずれのレベルでも適用でき、コンポーネントの順序は重要ではないことに注意してください。 when conditionとともに以下の演算子を使用できます: ### when-equal ```yaml when: equal: - << status.build.package >> - success when-not-equal ``` ### when-not-equal ```yaml not-equal: - << status.build.package >> - failed ``` ### when-not ```yaml when: -not:true ``` ### when-and/when-or ```yaml when: or: - and: - equal: - << pipeline.status.build >> - success - not-equal: - << pipeline.status.build.hello-world >> - failed - equal: - << pipeline.event.{{Event Variable Placeholder}} >> ``` > **注意:** [approval jobs](https://docs.catalyst.zoho.com/ja/pipelines/help/catalyst-pipelines.yaml/build-the-pipeline/jobs/approval-job/)にはwhen conditionsを設定できません。 ### グローバル設定 必要に応じて、pipelineレベルでwhen conditionを定義できます。この条件はpipelineの実行フローのみを決定します。以下のように条件を設定できます: ```yaml pipeline-when: equal: - << event.ref >> - refs/heads/main ```