Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languageserver/src/context-providers/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function getSecrets(
if (isString(x.value)) {
environmentName = x.value.value;
} else {
// this means we have a dynamic enviornment, in those situations we
// this means we have a dynamic environment, in those situations we
// want to make sure we skip doing secret validation
secretsContext.complete = false;
}
Expand Down
9 changes: 8 additions & 1 deletion languageserver/src/context-providers/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export async function getVariables(
return secretsContext;
}

const variablesContext = defaultContext || new DescriptionDictionary();

let environmentName: string | undefined;
if (workflowContext?.job?.environment) {
if (isString(workflowContext.job.environment)) {
Expand All @@ -35,14 +37,19 @@ export async function getVariables(
if (isString(x.key) && x.key.value === "name") {
if (isString(x.value)) {
environmentName = x.value.value;
} else {
// this means we have a dynamic environment, in those situations we want to skip validation
variablesContext.complete = false;
}
break;
}
}
} else {
// if the expression is something like environment: ${{ ... }} then we want to skip validation
variablesContext.complete = false;
}
}

const variablesContext = defaultContext || new DescriptionDictionary();
try {
const variables = await getRemoteVariables(octokit, cache, repo, environmentName);

Expand Down