From 2f88970fceba7acce67bd878824337d5790359c7 Mon Sep 17 00:00:00 2001 From: Josh Gross Date: Thu, 8 Dec 2022 14:05:04 -0500 Subject: [PATCH] Skip external context provider when value is null --- actions-languageservice/src/context-providers/default.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/actions-languageservice/src/context-providers/default.ts b/actions-languageservice/src/context-providers/default.ts index 9dca41e..784c693 100644 --- a/actions-languageservice/src/context-providers/default.ts +++ b/actions-languageservice/src/context-providers/default.ts @@ -1,4 +1,5 @@ import {data} from "@github/actions-expressions"; +import {Kind} from "@github/actions-expressions/data/expressiondata"; import {WorkflowContext} from "../context/workflow-context"; import {ContextProviderConfig} from "./config"; import {getInputsContext} from "./inputs"; @@ -21,6 +22,10 @@ export async function getContext( const filteredNames = filterContextNames(names, workflowContext); for (const contextName of filteredNames) { let value = (await getDefaultContext(contextName, workflowContext)) || new data.Dictionary(); + if (value.kind === Kind.Null) { + context.add(contextName, value); + continue; + } value = (await config?.getContext(contextName, value)) || value;