add scalar handling

This commit is contained in:
Felipe Suero
2023-04-11 13:54:53 -04:00
parent d58deaf097
commit 736dd1a66c
2 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -51,7 +51,7 @@ function convertStep(context: TemplateContext, idBuilder: IdBuilder, step: Templ
let id: StringToken | undefined;
let name: ScalarToken | undefined;
let uses: StringToken | undefined;
let continueOnError: boolean | undefined;
let continueOnError: boolean | ScalarToken | undefined;
let env: MappingToken | undefined;
const ifCondition = new BasicExpressionToken(undefined, undefined, "success()", undefined, undefined, undefined);
for (const item of mapping) {
@@ -81,6 +81,8 @@ function convertStep(context: TemplateContext, idBuilder: IdBuilder, step: Templ
case "continue-on-error":
if (!item.value.isExpression) {
continueOnError = item.value.assertBoolean("steps item continue-on-error").value;
} else {
continueOnError = item.value.assertScalar("steps item continue-on-error");
}
}
}
@@ -86,7 +86,7 @@ type BaseStep = {
id: string;
name?: ScalarToken;
if: BasicExpressionToken;
"continue-on-error"?: boolean;
"continue-on-error"?: boolean | ScalarToken;
env?: MappingToken;
};
@@ -154,12 +154,12 @@ export type PathFilterConfig = {
};
export type WorkflowDispatchConfig = {
inputs?: {[inputName: string]: InputConfig};
inputs?: { [inputName: string]: InputConfig };
};
export type WorkflowCallConfig = {
inputs?: {[inputName: string]: InputConfig & {default?: string | boolean | number | ScalarToken}};
secrets?: {[secretName: string]: SecretConfig};
inputs?: { [inputName: string]: InputConfig & { default?: string | boolean | number | ScalarToken } };
secrets?: { [secretName: string]: SecretConfig };
// TODO - these are supported in C# and Go but not in TS yet
// outputs: { [outputName: string]: OutputConfig }
};