Skip to content

Commit

Permalink
fix: azp: required number parameter (#251)
Browse files Browse the repository at this point in the history
* seen in the azure pipelines agent ci
  • Loading branch information
ChristopherHX authored Oct 29, 2023
1 parent e269fd6 commit 3feb671
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sdk/AzurePipelines/AzureDevops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public static async Task<MappingToken> ReadTemplate(Runner.Server.Azure.Devops.C
templateContext.Error(sparameters, "A value for the 'name' parameter must be provided.");
continue;
}
var defCtxData = await ConvertValue(context, def, type, values);
var defCtxData = def == null ? null : await ConvertValue(context, def, type, values);
if(cparameters?.TryGetValue(name, out var value) == true || def == null && (value = await (context.RequiredParametersProvider?.GetRequiredParameter(name) ?? Task.FromResult<TemplateToken>(null))) != null) {
parametersData[name] = await ConvertValue(context, value, type, values);
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
steps:
- template: tmpl.yml
parameters:
no: 42
5 changes: 5 additions & 0 deletions testworkflows/azpipelines/required-parameter-number/tmpl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
- name: no
type: number
steps:
- script: echo ok

0 comments on commit 3feb671

Please sign in to comment.