Skip to content

Commit 1ff96d2

Browse files
committed
skip validation for dynamic environment
1 parent e2ec264 commit 1ff96d2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

languageserver/src/context-providers/secrets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function getSecrets(
4949
if (isString(x.value)) {
5050
environmentName = x.value.value;
5151
} else {
52-
// this means we have a dynamic enviornment, in those situations we
52+
// this means we have a dynamic environment, in those situations we
5353
// want to make sure we skip doing secret validation
5454
secretsContext.complete = false;
5555
}

languageserver/src/context-providers/variables.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export async function getVariables(
2626
return secretsContext;
2727
}
2828

29+
const variablesContext = defaultContext || new DescriptionDictionary();
30+
2931
let environmentName: string | undefined;
3032
if (workflowContext?.job?.environment) {
3133
if (isString(workflowContext.job.environment)) {
@@ -35,14 +37,19 @@ export async function getVariables(
3537
if (isString(x.key) && x.key.value === "name") {
3638
if (isString(x.value)) {
3739
environmentName = x.value.value;
40+
} else {
41+
// this means we have a dynamic environment, in those situations we want to skip validation
42+
variablesContext.complete = false;
3843
}
3944
break;
4045
}
4146
}
47+
} else {
48+
// if the expression is something like environment: ${{ ... }} then we want to skip validation
49+
variablesContext.complete = false;
4250
}
4351
}
4452

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

0 commit comments

Comments
 (0)