Create a condition based on the values of add_run_variables environment variable, so that a step can be skipped based on dynamically set variables before it gets assigned to a node.
Note
When using a condition, boolean values must be enclosed in quotes.
Examples:
condition: 'trigger == "true"'condition: "trigger == 'true'"condition: trigger == 'true'condition: trigger == "true"
Note
Pipelines environment variables cannot be added as a condition.
YAML Schema
steps:
- name: <step_name>
type: <step_type>
execution:
onExecute:
- add_run_variables 'key=value'
- name: <step_name>
type: <step_type>
configuration:
condition: 'key == value' # Any logical boolean expression that results in a boolean
inputSteps:
- name: <step_name>Example
pipelines:
- name: Example
steps:
- name: step1
type: Bash
execution:
onExecute:
- echo 'step1'
- add_run_variables 'var1=1'
- name: step2
type: Bash
configuration:
condition: 'var1 == 1' # Any logical boolean expression that results to a boolean
inputSteps:
- name: step1
execution:
onExecute:
- echo 'success'