Fix Job references in language server
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {data, DescriptionDictionary, isDescriptionDictionary} from "@github/actions-expressions";
|
||||
import {parseActionReference} from "@github/actions-languageservice/action";
|
||||
import {WorkflowContext} from "@github/actions-languageservice/context/workflow-context";
|
||||
import {isActionStep} from "@github/actions-workflow-parser/model/type-guards";
|
||||
import {isActionStep, isReusableWorkflowJob} from "@github/actions-workflow-parser/model/type-guards";
|
||||
import {Octokit} from "@octokit/rest";
|
||||
import {TTLCache} from "../utils/cache";
|
||||
import {getActionOutputs} from "./action-outputs";
|
||||
@@ -12,7 +12,8 @@ export async function getStepsContext(
|
||||
defaultContext: DescriptionDictionary | undefined,
|
||||
workflowContext: WorkflowContext
|
||||
): Promise<DescriptionDictionary | undefined> {
|
||||
if (!defaultContext || !workflowContext.job) {
|
||||
const job = workflowContext.job;
|
||||
if (!defaultContext || !job || isReusableWorkflowJob(job)) {
|
||||
return defaultContext;
|
||||
}
|
||||
|
||||
@@ -26,7 +27,7 @@ export async function getStepsContext(
|
||||
// Copy the default context for each step
|
||||
// If the step is an action, add the action outputs to the context
|
||||
const stepsContext = new DescriptionDictionary();
|
||||
for (const step of workflowContext.job.steps) {
|
||||
for (const step of job.steps) {
|
||||
if (!contextSteps.has(step.id)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user