Skip to content

Conditions

Conditions are used to describe when and where your pipeline and further individual pipeline steps should be run by adding them to the corresponding when field.

With a condition, a set of comparison values (selected from a fact, environment variable or runtime variable) is tested against a defined set of rules:

RuleDescription
includeAt least one of the provided values must be contained in the set of comparison values
excludeNone of the provided values may be contained in the set of comparison values
matchAt least one of the provided regular expressions must match at least one of the comparison values
mismatchNone of the provided regular expressions may match any of the comparison values

If a set of comparison values is empty or a rule is empty, the condition is always met. If there are multiple rules for a single set of comparison values, those rules are combined with logical AND.

Facts

Facts are pieces of information used to provide context when checking conditions. They can relate to the environment where your pipeline is hosted, an event or arbitrary other information. A single fact can describe multiple values at once, e.g. an array of files that were changed in a specific Git commit or similar.

The following facts are provided by default:

ConditionDescription
workerGroupAvailable worker groups - the pipeline is executed on each matching worker group (string)

Git based pipelines

The following facts are provided for Git based pipelines:

ConditionDescription
triggerThe type of event - either a combination of push and commit or tag, or action ("push" | "commit" | "tag" | "action")
actionAction (available for action triggers) (string)
refGit ref of the head commit or tag, e.g. refs/heads/main or refs/tags/v1.0.0 (string)
branchGit branch (not available for tag triggers) (string)
tagGit tag (available for tag triggers) (string)
fileAffected file(s) (available for commit triggers) (string)
repositoryFull name of the Git repository, e.g. reeveci/reeve

The following default conditions apply to pipelines defined in Git repositories (e.g. using the Gitea plugin):

  • Pipelines run only on commit by default
  • Pipelines run only on the Git repository's default branch
  • All actions are excluded by default (this prevents your pipeline from running always if you set trigger to action but forget to add a condition for action)