Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: azp: required number parameter #251

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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