Conditional Execution of Steps
For each step in a
codefresh.yml file, you can define a set of conditions which need to be satisfied in order to execute the step. (An introduction to the
codefresh.yml file can be found here.)
There are currently two main methods to define conditions: branch conditions and expression conditions.
Usually, you’ll want to define a branch condition, be it of the type
ignore for blacklisting a set of branches or of the type
only for whitelisting a set of branches. Each branch specification can either be an exact branch name, e.g.
master, or a regular expression, e.g.
/hotfix$/. Case insensitive regexps (
/^FB-/i) are also supported.
Here are some examples:
Only execute for the
Only execute for branches whose name begins with
FB- prefix (feature branches):
Ignore the develop branch and master branch:
Regular Expressions Flavour
Alternatively, you can use more advanced condition expressions.
This follows the standard condition expression syntax. In this case, you can choose to execute if
all expression conditions evaluate to
true, or to execute if
any expression conditions evaluate to
Here are some examples. Execute if the string
[skip ci] is not part of the main repository commit message AND if the branch is
Execute if the string
[skip ci] is not part of the main repository commit message, OR if the branch is not a feature branch (i.e. name starts with FB-)