Closed premun closed 1 year ago
It is currently not possible to create following YAML template:
parameters: agentOs: '' steps: [] steps: - ${{ if eq(parameters.agentOs, 'Windows_NT') }}: - ${{ parameters.steps }}
There is no mechanism to inject parameter reference instead of an arbitrary piece of the definition.
The C# for this would look something like this:
public class RunOnWindowsTemplate : StepTemplateDefinition { public override string TargetFile => "run-on-windows.yml"; public override List<Parameter> Parameters => new() { StringParameter("agentOs"), StepListParameter("steps"), }; public override ConditionedList<Step> Definition => new() { If.Equal(parameters["agentOs"], "Windows_NT") .Step(/* New stuff goes here */) }; }
Problem
It is currently not possible to create following YAML template:
There is no mechanism to inject parameter reference instead of an arbitrary piece of the definition.
The C# for this would look something like this: