Best effort conversion when validating
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
ParseWorkflowResult,
|
ParseWorkflowResult,
|
||||||
WorkflowTemplate
|
WorkflowTemplate
|
||||||
} from "@github/actions-workflow-parser";
|
} from "@github/actions-workflow-parser";
|
||||||
|
import {ErrorPolicy} from "@github/actions-workflow-parser/model/convert";
|
||||||
import {splitAllowedContext} from "@github/actions-workflow-parser/templates/allowed-context";
|
import {splitAllowedContext} from "@github/actions-workflow-parser/templates/allowed-context";
|
||||||
import {BasicExpressionToken} from "@github/actions-workflow-parser/templates/tokens/basic-expression-token";
|
import {BasicExpressionToken} from "@github/actions-workflow-parser/templates/tokens/basic-expression-token";
|
||||||
import {StringToken} from "@github/actions-workflow-parser/templates/tokens/string-token";
|
import {StringToken} from "@github/actions-workflow-parser/templates/tokens/string-token";
|
||||||
@@ -49,8 +50,8 @@ export async function validate(
|
|||||||
try {
|
try {
|
||||||
const result: ParseWorkflowResult = parseWorkflow(file.name, [file], nullTrace);
|
const result: ParseWorkflowResult = parseWorkflow(file.name, [file], nullTrace);
|
||||||
if (result.value) {
|
if (result.value) {
|
||||||
// Errors will be updated in the context
|
// Errors will be updated in the context. Attempt to do the conversion anyway in order to give the user more information
|
||||||
const template = convertWorkflowTemplate(result.context, result.value);
|
const template = convertWorkflowTemplate(result.context, result.value, ErrorPolicy.TryConversion);
|
||||||
|
|
||||||
// Validate expressions and value providers
|
// Validate expressions and value providers
|
||||||
await additionalValidations(
|
await additionalValidations(
|
||||||
|
|||||||
Reference in New Issue
Block a user