Class TargetCondition
A workflow option that gates execution of a target's job on a platform-evaluated condition expression.
public sealed record TargetCondition : IBuildOption, IImplicitTargetDependencyOption
- Inheritance
-
objectTargetCondition
- Implements
Remarks
Typically created via BuildOptions.Target.RunIfWorkflowCondition(...). The expression is rendered
into the generated workflow file using the syntax of the targeted CI/CD platform.
Constructors
TargetCondition(BoolExpr)
A workflow option that gates execution of a target's job on a platform-evaluated condition expression.
public TargetCondition(BoolExpr Condition)
Parameters
ConditionBoolExprThe condition expression to evaluate. May reference outputs of other targets via Invex.StructuredText.Expressions.JobOutputRef. Those targets are not added as dependencies: declare them with
DependsOn, or workflow resolution logs a warning (the platform can only read outputs of jobs the conditioned job needs).
Remarks
Typically created via BuildOptions.Target.RunIfWorkflowCondition(...). The expression is rendered
into the generated workflow file using the syntax of the targeted CI/CD platform.
Properties
Condition
The condition expression to evaluate. May reference outputs of other targets via
Invex.StructuredText.Expressions.JobOutputRef. Those targets are not added as dependencies: declare them with
DependsOn, or workflow resolution logs a warning (the platform can only read outputs of jobs the
conditioned job needs).
public BoolExpr Condition { get; init; }
Property Value
- BoolExpr
TargetNames
Gets the names of targets whose outputs are referenced by Condition. Workflow resolution checks that each is a declared dependency of the conditioned target and logs a warning if not.
public IEnumerable<string> TargetNames { get; }
Property Value
- IEnumerable<string>