All Products
Search
Document Center

Alibaba Cloud DevOps:YAML syntax examples

Last Updated:Mar 31, 2025

This topic describes the common examples of using the YAML syntax.

YAML syntax examples

YAML is widely used in various scenarios due to its simplicity and ease of understanding. YAML controls the execution conditions of jobs in pipelines, including the job execution orders. The following part describes a few YAML syntax examples:

condition syntax

You can use the condition syntax in a pipeline to determine whether to execute a job. For more information, see Use the condition syntax to control job execution.

needs syntax

You can use the needs syntax in a pipeline to control the job execution order. For more information, see Use the needs syntax to control job dependencies.

template syntax

You can use the template syntax in a pipeline to dynamically render YAML, reduce duplicated codes in a YAML-based pipeline, and flexibly orchestrate multiple jobs. For more information, see Use the template syntax to dynamically configure a pipeline.