Skip to main content
Version: 5.8.x

ConditionExpression

Conditional expressions.

Use to build up a conditional state, and can be composed in novel ways. There must only be one property defined on a single condition, and the terminal must always define an "equals".

Conditions can contain placeholders variables, in the form ${VARIABLE}.

Condition on the task running being successful:

Example

equals:
- "${TASK_RESULT}"
- "success"

Condition on a branch name being "main" or "hotfix":

Example

or:
- equals:
- ${BRANCH_NAME}"
- "main"
- equals:
- ${BRANCH_NAME}"
- "hotfix"

Conditions can also be negated:

Example

not:
equals:
- "$BRANCH_NAME"
- "main"

Table of contents

Properties

Properties

and

Optional and: ConditionExpression[]

If set, the given conditions must all evaluate truthy for this condition to pass.


equals

Optional equals: [string, string]

The main "condition" which will evaluate truthy if both sides of the expression are equal.

Note that types are not considered when evaluating equality, and values are coerced to strings.


not

Optional not: ConditionExpression

If set, the result of the given condition is negated.


or

Optional or: ConditionExpression[]

If set, at least one of the given conditions must evaluate truthy for this condition to pass.