Merge pull request #19 from actions/felipesu19-on-error-tokens
Fixes errors around "on-error" token parsing
This commit is contained in:
@@ -50,7 +50,7 @@ function convertStep(context: TemplateContext, idBuilder: IdBuilder, step: Templ
|
|||||||
let id: StringToken | undefined;
|
let id: StringToken | undefined;
|
||||||
let name: ScalarToken | undefined;
|
let name: ScalarToken | undefined;
|
||||||
let uses: StringToken | undefined;
|
let uses: StringToken | undefined;
|
||||||
let continueOnError: boolean | undefined;
|
let continueOnError: boolean | ScalarToken | undefined;
|
||||||
let env: MappingToken | undefined;
|
let env: MappingToken | undefined;
|
||||||
const ifCondition = new BasicExpressionToken(undefined, undefined, "success()", undefined, undefined, undefined);
|
const ifCondition = new BasicExpressionToken(undefined, undefined, "success()", undefined, undefined, undefined);
|
||||||
for (const item of mapping) {
|
for (const item of mapping) {
|
||||||
@@ -78,7 +78,11 @@ function convertStep(context: TemplateContext, idBuilder: IdBuilder, step: Templ
|
|||||||
env = item.value.assertMapping("step env");
|
env = item.value.assertMapping("step env");
|
||||||
break;
|
break;
|
||||||
case "continue-on-error":
|
case "continue-on-error":
|
||||||
continueOnError = item.value.assertBoolean("steps item continue-on-error").value;
|
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;
|
id: string;
|
||||||
name?: ScalarToken;
|
name?: ScalarToken;
|
||||||
if: BasicExpressionToken;
|
if: BasicExpressionToken;
|
||||||
"continue-on-error"?: boolean;
|
"continue-on-error"?: boolean | ScalarToken;
|
||||||
env?: MappingToken;
|
env?: MappingToken;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user