@actions/languageservice 0.3.20 → 0.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expression-hover/expression-pos.d.ts +11 -0
- package/dist/expression-hover/expression-pos.d.ts.map +1 -1
- package/dist/expression-hover/expression-pos.js +36 -1
- package/dist/expression-hover/expression-pos.js.map +1 -1
- package/dist/hover.d.ts.map +1 -1
- package/dist/hover.js +1 -18
- package/dist/hover.js.map +1 -1
- package/dist/utils/expression-detection.d.ts.map +1 -1
- package/dist/utils/expression-detection.js +4 -3
- package/dist/utils/expression-detection.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +402 -4
- package/dist/validate.js.map +1 -1
- package/package.json +4 -4
|
@@ -9,5 +9,16 @@ export type ExpressionPos = {
|
|
|
9
9
|
/** Range of the expression in the document */
|
|
10
10
|
documentRange: LSPRange;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Maps a document position to an expression position for hover/completion features.
|
|
14
|
+
*
|
|
15
|
+
* This handles both explicit expressions (with ${{ }}) and implicit expressions (like if conditions).
|
|
16
|
+
* For if conditions without ${{ }}, this applies the same conversion as the parser's convertToIfCondition,
|
|
17
|
+
* wrapping them in `success() && (...)` when no status function is present.
|
|
18
|
+
*
|
|
19
|
+
* @param token The template token at the position
|
|
20
|
+
* @param position The position in the document
|
|
21
|
+
* @returns Expression and adjusted position, or undefined if not an expression
|
|
22
|
+
*/
|
|
12
23
|
export declare function mapToExpressionPos(token: TemplateToken, position: Position): ExpressionPos | undefined;
|
|
13
24
|
//# sourceMappingURL=expression-pos.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression-pos.d.ts","sourceRoot":"","sources":["../../src/expression-hover/expression-pos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"expression-pos.d.ts","sourceRoot":"","sources":["../../src/expression-hover/expression-pos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,4BAA4B,CAAC;AAE/C,OAAO,EAAC,aAAa,EAAC,MAAM,0DAA0D,CAAC;AAEvF,OAAO,EAAC,QAAQ,EAAE,KAAK,IAAI,QAAQ,EAAC,MAAM,oCAAoC,CAAC;AAI/E,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IAEnB,sDAAsD;IACtD,QAAQ,EAAE,GAAG,CAAC;IAEd,8CAA8C;IAC9C,aAAa,EAAE,QAAQ,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,aAAa,GAAG,SAAS,CAsEtG"}
|
|
@@ -1,11 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ensureStatusFunction } from "@actions/workflow-parser/model/converter/if-condition";
|
|
2
|
+
import { isBasicExpression, isString } from "@actions/workflow-parser/templates/tokens/type-guards";
|
|
2
3
|
import { mapRange } from "../utils/range";
|
|
3
4
|
import { posWithinRange } from "./pos-range";
|
|
5
|
+
/**
|
|
6
|
+
* Maps a document position to an expression position for hover/completion features.
|
|
7
|
+
*
|
|
8
|
+
* This handles both explicit expressions (with ${{ }}) and implicit expressions (like if conditions).
|
|
9
|
+
* For if conditions without ${{ }}, this applies the same conversion as the parser's convertToIfCondition,
|
|
10
|
+
* wrapping them in `success() && (...)` when no status function is present.
|
|
11
|
+
*
|
|
12
|
+
* @param token The template token at the position
|
|
13
|
+
* @param position The position in the document
|
|
14
|
+
* @returns Expression and adjusted position, or undefined if not an expression
|
|
15
|
+
*/
|
|
4
16
|
export function mapToExpressionPos(token, position) {
|
|
5
17
|
const pos = {
|
|
6
18
|
line: position.line + 1,
|
|
7
19
|
column: position.character + 1
|
|
8
20
|
};
|
|
21
|
+
// Handle if conditions that are string tokens (job-if, step-if, snapshot-if)
|
|
22
|
+
const definitionKey = token.definition?.key;
|
|
23
|
+
if (isString(token) &&
|
|
24
|
+
token.range &&
|
|
25
|
+
(definitionKey === "job-if" || definitionKey === "step-if" || definitionKey === "snapshot-if")) {
|
|
26
|
+
const condition = token.value.trim();
|
|
27
|
+
if (condition) {
|
|
28
|
+
// Ensure the condition has a status function, wrapping if needed
|
|
29
|
+
const finalCondition = ensureStatusFunction(condition, token.definitionInfo);
|
|
30
|
+
const exprRange = mapRange(token.range);
|
|
31
|
+
// Calculate offset: find where the original condition appears in the final expression
|
|
32
|
+
// If wrapped, it will be after "success() && (", otherwise it's at position 0
|
|
33
|
+
const offset = finalCondition.indexOf(condition);
|
|
34
|
+
return {
|
|
35
|
+
expression: finalCondition,
|
|
36
|
+
position: {
|
|
37
|
+
line: pos.line - exprRange.start.line - 1,
|
|
38
|
+
column: pos.column - exprRange.start.character - 1 + offset
|
|
39
|
+
},
|
|
40
|
+
documentRange: exprRange
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
9
44
|
if (!isBasicExpression(token)) {
|
|
10
45
|
return undefined;
|
|
11
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression-pos.js","sourceRoot":"","sources":["../../src/expression-hover/expression-pos.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expression-pos.js","sourceRoot":"","sources":["../../src/expression-hover/expression-pos.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,uDAAuD,CAAC;AAE3F,OAAO,EAAC,iBAAiB,EAAE,QAAQ,EAAC,MAAM,uDAAuD,CAAC;AAElG,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAa3C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAoB,EAAE,QAAkB;IACzE,MAAM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,cAAc,CAAC,GAAG,EAAE,WAAW,CAAC,eAAe,CAAC,EAAE;gBACnF,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;gBAExD,OAAO;oBACL,UAAU,EAAE,WAAW,CAAC,UAAU;oBAClC,mDAAmD;oBACnD,QAAQ,EAAE;wBACR,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;wBACzC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC;qBACnD;oBACD,aAAa,EAAE,SAAS;iBACzB,CAAC;aACH;SACF;QAED,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAClD,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,mDAAmD;QACnD,QAAQ,EAAE;YACR,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;YACzC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC;SACnD;QACD,aAAa,EAAE,SAAS;KACzB,CAAC;AACJ,CAAC"}
|
package/dist/hover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../src/hover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../src/hover.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,aAAa,EAAC,MAAM,0DAA0D,CAAC;AAGvF,OAAO,EAAC,YAAY,EAAC,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAC,KAAK,EAAC,MAAM,6BAA6B,CAAC;AAClD,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AAGjE,OAAO,EAAqB,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAa/E,MAAM,MAAM,WAAW,GAAG;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACpH,CAAC;AAEF,wBAAsB,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAoEnH"}
|
package/dist/hover.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { data, Parser } from "@actions/expressions";
|
|
2
2
|
import { Lexer } from "@actions/expressions/lexer";
|
|
3
3
|
import { ErrorPolicy } from "@actions/workflow-parser/model/convert";
|
|
4
|
-
import { getCronDescription } from "@actions/workflow-parser/model/converter/cron";
|
|
5
4
|
import { splitAllowedContext } from "@actions/workflow-parser/templates/allowed-context";
|
|
6
|
-
import { isBasicExpression
|
|
5
|
+
import { isBasicExpression } from "@actions/workflow-parser/templates/tokens/type-guards";
|
|
7
6
|
import { getContext, Mode } from "./context-providers/default";
|
|
8
7
|
import { getFunctionDescription } from "./context-providers/descriptions";
|
|
9
8
|
import { getWorkflowContext } from "./context/workflow-context";
|
|
@@ -51,16 +50,6 @@ export async function hover(document, position, config) {
|
|
|
51
50
|
return null;
|
|
52
51
|
}
|
|
53
52
|
info(`Calculating hover for token with definition ${token.definition.key}`);
|
|
54
|
-
if (tokenResult.parent && isCronMappingValue(tokenResult)) {
|
|
55
|
-
const tokenValue = token.value;
|
|
56
|
-
const description = getCronDescription(tokenValue);
|
|
57
|
-
if (description) {
|
|
58
|
-
return {
|
|
59
|
-
contents: description,
|
|
60
|
-
range: mapRange(token.range)
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
53
|
if (tokenResult.parent && isReusableWorkflowJobInput(tokenResult)) {
|
|
65
54
|
let description = getReusableWorkflowInputDescription(workflowContext, tokenResult);
|
|
66
55
|
description = appendContext(description, token.definitionInfo?.allowedContext);
|
|
@@ -104,12 +93,6 @@ async function getDescription(config, workflowContext, token, path) {
|
|
|
104
93
|
const description = await config.descriptionProvider.getDescription(workflowContext, token, path);
|
|
105
94
|
return description || defaultDescription;
|
|
106
95
|
}
|
|
107
|
-
function isCronMappingValue(tokenResult) {
|
|
108
|
-
return (tokenResult.parent?.definition?.key === "cron-mapping" &&
|
|
109
|
-
!!tokenResult.token &&
|
|
110
|
-
isString(tokenResult.token) &&
|
|
111
|
-
tokenResult.token.value !== "cron");
|
|
112
|
-
}
|
|
113
96
|
function expressionHover(exprPos, context, namedContexts, functions) {
|
|
114
97
|
const { expression, position, documentRange } = exprPos;
|
|
115
98
|
try {
|
package/dist/hover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.js","sourceRoot":"","sources":["../src/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAyB,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAC,KAAK,EAAC,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"hover.js","sourceRoot":"","sources":["../src/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAyB,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAC,KAAK,EAA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,CAAC;KACH;IAAC,OAAO,CAAC,EAAE;QACV,qEAAqE;QACrE,IAAI,CAAC,2DAA4D,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACxF,OAAO,IAAI,CAAC;KACb;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression-detection.d.ts","sourceRoot":"","sources":["../../src/utils/expression-detection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expression-detection.d.ts","sourceRoot":"","sources":["../../src/utils/expression-detection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,iDAAiD,CAAC;AAE9E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAMrE"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { isString } from "@actions/workflow-parser";
|
|
2
|
-
import { DefinitionType } from "@actions/workflow-parser/templates/schema/definition-type";
|
|
3
2
|
import { OPEN_EXPRESSION } from "@actions/workflow-parser/templates/template-constants";
|
|
4
3
|
export function isPotentiallyExpression(token) {
|
|
5
|
-
const isAlwaysExpression = token.definition?.definitionType === DefinitionType.String && token.definition.isExpression;
|
|
6
4
|
const containsExpression = isString(token) && token.value != null && token.value.indexOf(OPEN_EXPRESSION) >= 0;
|
|
7
|
-
|
|
5
|
+
// If conditions are always expressions (job-if, step-if, snapshot-if)
|
|
6
|
+
const definitionKey = token.definition?.key;
|
|
7
|
+
const isIfCondition = definitionKey === "job-if" || definitionKey === "step-if" || definitionKey === "snapshot-if";
|
|
8
|
+
return containsExpression || isIfCondition;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=expression-detection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression-detection.js","sourceRoot":"","sources":["../../src/utils/expression-detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"expression-detection.js","sourceRoot":"","sources":["../../src/utils/expression-detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,uDAAuD,CAAC;AAGtF,MAAM,UAAU,uBAAuB,CAAC,KAAoB;IAC1D,MAAM,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC/G,sEAAsE;IACtE,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC;IAC5C,MAAM,aAAa,GAAG,aAAa,KAAK,QAAQ,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,KAAK,aAAa,CAAC;IACnH,OAAO,kBAAkB,IAAI,aAAa,CAAC;AAC7C,CAAC"}
|
package/dist/validate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,YAAY,EAAC,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAC,UAAU,EAA0B,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AACzD,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AAWjE,OAAO,EAAC,mBAAmB,EAAoB,MAAM,0BAA0B,CAAC;AAMhF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;CACnF,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAuC3G"}
|
package/dist/validate.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { Lexer, Parser } from "@actions/expressions";
|
|
1
|
+
import { Lexer, Parser, data } from "@actions/expressions";
|
|
2
|
+
import { FunctionCall, Literal, Logical } from "@actions/expressions/ast";
|
|
2
3
|
import { isBasicExpression, isString } from "@actions/workflow-parser";
|
|
3
4
|
import { ErrorPolicy } from "@actions/workflow-parser/model/convert";
|
|
5
|
+
import { getCronDescription, hasCronIntervalLessThan5Minutes } from "@actions/workflow-parser/model/converter/cron";
|
|
6
|
+
import { ensureStatusFunction } from "@actions/workflow-parser/model/converter/if-condition";
|
|
4
7
|
import { splitAllowedContext } from "@actions/workflow-parser/templates/allowed-context";
|
|
8
|
+
import { BasicExpressionToken } from "@actions/workflow-parser/templates/tokens/basic-expression-token";
|
|
5
9
|
import { TemplateToken } from "@actions/workflow-parser/templates/tokens/template-token";
|
|
6
10
|
import { DiagnosticSeverity } from "vscode-languageserver-types";
|
|
7
11
|
import { Mode, getContext } from "./context-providers/default";
|
|
@@ -16,6 +20,7 @@ import { fetchOrConvertWorkflowTemplate, fetchOrParseWorkflow } from "./utils/wo
|
|
|
16
20
|
import { validateAction } from "./validate-action";
|
|
17
21
|
import { ValueProviderKind } from "./value-providers/config";
|
|
18
22
|
import { defaultValueProviders } from "./value-providers/default";
|
|
23
|
+
const CRON_SCHEDULE_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#onschedule";
|
|
19
24
|
/**
|
|
20
25
|
* Validates a workflow file
|
|
21
26
|
*
|
|
@@ -64,12 +69,45 @@ async function additionalValidations(diagnostics, documentUri, template, root, c
|
|
|
64
69
|
const validationDefinition = validationToken.definition;
|
|
65
70
|
// If this is an expression, validate it
|
|
66
71
|
if (isBasicExpression(token) && token.range) {
|
|
67
|
-
await validateExpression(diagnostics, token, validationToken.definitionInfo?.allowedContext || [], config?.contextProviderConfig, getProviderContext(documentUri, template, root, token.range));
|
|
72
|
+
await validateExpression(diagnostics, token, validationToken.definitionInfo?.allowedContext || [], config?.contextProviderConfig, getProviderContext(documentUri, template, root, token.range), key?.definition?.key);
|
|
68
73
|
}
|
|
74
|
+
// If this is a job-if, step-if, or snapshot-if field (which are strings that should be treated as expressions), validate it
|
|
75
|
+
const definitionKey = token.definition?.key;
|
|
76
|
+
if (isString(token) &&
|
|
77
|
+
token.range &&
|
|
78
|
+
(definitionKey === "job-if" || definitionKey === "step-if" || definitionKey === "snapshot-if")) {
|
|
79
|
+
// Convert the string to an expression token for validation
|
|
80
|
+
const condition = token.value.trim();
|
|
81
|
+
if (condition) {
|
|
82
|
+
// Ensure the condition has a status function, wrapping if needed
|
|
83
|
+
const finalCondition = ensureStatusFunction(condition, token.definitionInfo);
|
|
84
|
+
// Create a BasicExpressionToken for validation
|
|
85
|
+
const expressionToken = new BasicExpressionToken(token.file, token.range, finalCondition, token.definitionInfo, undefined, token.source);
|
|
86
|
+
await validateExpression(diagnostics, expressionToken, validationToken.definitionInfo?.allowedContext || [], config?.contextProviderConfig, getProviderContext(documentUri, template, root, token.range));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Validate step uses field format
|
|
90
|
+
if (isString(token) && token.range && validationDefinition?.key === "step-uses") {
|
|
91
|
+
validateStepUsesFormat(diagnostics, token);
|
|
92
|
+
}
|
|
93
|
+
// Validate action metadata (inputs, required fields) for regular steps
|
|
69
94
|
if (token.definition?.key === "regular-step" && token.range) {
|
|
70
95
|
const context = getProviderContext(documentUri, template, root, token.range);
|
|
71
96
|
await validateAction(diagnostics, token, context.step, config);
|
|
72
97
|
}
|
|
98
|
+
// Validate job-level reusable workflow uses field format
|
|
99
|
+
if (isString(token) &&
|
|
100
|
+
token.range &&
|
|
101
|
+
key &&
|
|
102
|
+
isString(key) &&
|
|
103
|
+
key.value === "uses" &&
|
|
104
|
+
parent?.definition?.key === "workflow-job") {
|
|
105
|
+
validateWorkflowUsesFormat(diagnostics, token);
|
|
106
|
+
}
|
|
107
|
+
// Validate cron expressions - warn if interval is less than 5 minutes
|
|
108
|
+
if (isString(token) && token.range && validationDefinition?.key === "cron-pattern") {
|
|
109
|
+
validateCronExpression(diagnostics, token);
|
|
110
|
+
}
|
|
73
111
|
// Allowed values coming from the schema have already been validated. Only check if
|
|
74
112
|
// a value provider is defined for a token and if it is, validate the values match.
|
|
75
113
|
if (token.range && validationDefinition) {
|
|
@@ -113,6 +151,292 @@ function invalidValue(diagnostics, token, kind) {
|
|
|
113
151
|
// no messages for SuggestedValues
|
|
114
152
|
}
|
|
115
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Validates cron expressions and provides diagnostics for valid cron schedules.
|
|
156
|
+
* Shows a warning if the interval is less than 5 minutes (since GitHub Actions
|
|
157
|
+
* schedules run at most every 5 minutes), otherwise shows an info message.
|
|
158
|
+
*/
|
|
159
|
+
function validateCronExpression(diagnostics, token) {
|
|
160
|
+
const cronValue = token.value;
|
|
161
|
+
// Ensure we have a range for diagnostics
|
|
162
|
+
if (!token.range) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
// Only check valid cron expressions - invalid ones are already caught by the parser
|
|
166
|
+
const description = getCronDescription(cronValue);
|
|
167
|
+
if (!description) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
// Check if the cron specifies an interval less than 5 minutes
|
|
171
|
+
if (hasCronIntervalLessThan5Minutes(cronValue)) {
|
|
172
|
+
diagnostics.push({
|
|
173
|
+
message: `${description}. Note: Actions schedules run at most every 5 minutes.`,
|
|
174
|
+
range: mapRange(token.range),
|
|
175
|
+
severity: DiagnosticSeverity.Warning,
|
|
176
|
+
code: "on-schedule",
|
|
177
|
+
codeDescription: {
|
|
178
|
+
href: CRON_SCHEDULE_DOCS_URL
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
// Show info message for valid cron expressions
|
|
184
|
+
diagnostics.push({
|
|
185
|
+
message: description,
|
|
186
|
+
range: mapRange(token.range),
|
|
187
|
+
severity: DiagnosticSeverity.Information,
|
|
188
|
+
code: "on-schedule",
|
|
189
|
+
codeDescription: {
|
|
190
|
+
href: CRON_SCHEDULE_DOCS_URL
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Validates the format of a step's `uses` field.
|
|
197
|
+
*
|
|
198
|
+
* Valid formats:
|
|
199
|
+
* - docker://image:tag
|
|
200
|
+
* - ./local/path
|
|
201
|
+
* - .\local\path (Windows)
|
|
202
|
+
* - {owner}/{repo}@{ref}
|
|
203
|
+
* - {owner}/{repo}/{path}@{ref}
|
|
204
|
+
*/
|
|
205
|
+
function validateStepUsesFormat(diagnostics, token) {
|
|
206
|
+
const uses = token.value;
|
|
207
|
+
// Empty uses value
|
|
208
|
+
if (!uses) {
|
|
209
|
+
diagnostics.push({
|
|
210
|
+
message: "`uses' value in action cannot be blank",
|
|
211
|
+
severity: DiagnosticSeverity.Error,
|
|
212
|
+
range: mapRange(token.range),
|
|
213
|
+
code: "invalid-uses-format"
|
|
214
|
+
});
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
// Docker image reference - always valid format
|
|
218
|
+
if (uses.startsWith("docker://")) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
// Local action path - always valid format
|
|
222
|
+
if (uses.startsWith("./") || uses.startsWith(".\\")) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
// Remote action: must be {owner}/{repo}[/path]@{ref}
|
|
226
|
+
const atSegments = uses.split("@");
|
|
227
|
+
// Must have exactly one @
|
|
228
|
+
if (atSegments.length !== 2) {
|
|
229
|
+
addStepUsesFormatError(diagnostics, token);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const [repoPath, gitRef] = atSegments;
|
|
233
|
+
// Ref cannot be empty
|
|
234
|
+
if (!gitRef) {
|
|
235
|
+
addStepUsesFormatError(diagnostics, token);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
// Split by / or \ to get path segments
|
|
239
|
+
const pathSegments = repoPath.split(/[\\/]/);
|
|
240
|
+
// Must have at least owner and repo (both non-empty)
|
|
241
|
+
if (pathSegments.length < 2 || !pathSegments[0] || !pathSegments[1]) {
|
|
242
|
+
addStepUsesFormatError(diagnostics, token);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
// Check if this is a reusable workflow reference (should be at job level, not step)
|
|
246
|
+
// Path would be like: owner/repo/.github/workflows/file.yml
|
|
247
|
+
if (pathSegments.length >= 4 && pathSegments[2] === ".github" && pathSegments[3] === "workflows") {
|
|
248
|
+
diagnostics.push({
|
|
249
|
+
message: "Reusable workflows should be referenced at the top-level `jobs.<job_id>.uses` key, not within steps",
|
|
250
|
+
severity: DiagnosticSeverity.Error,
|
|
251
|
+
range: mapRange(token.range),
|
|
252
|
+
code: "invalid-uses-format"
|
|
253
|
+
});
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function addStepUsesFormatError(diagnostics, token) {
|
|
258
|
+
diagnostics.push({
|
|
259
|
+
message: `Expected format {owner}/{repo}[/path]@{ref}. Actual '${token.value}'`,
|
|
260
|
+
severity: DiagnosticSeverity.Error,
|
|
261
|
+
range: mapRange(token.range),
|
|
262
|
+
code: "invalid-uses-format"
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Validates the format of a job's `uses` field (reusable workflow reference).
|
|
267
|
+
*
|
|
268
|
+
* Valid formats:
|
|
269
|
+
* - {owner}/{repo}/.github/workflows/{filename}.yml@{ref}
|
|
270
|
+
* - {owner}/{repo}/.github/workflows/{filename}.yaml@{ref}
|
|
271
|
+
* - {owner}/{repo}/.github/workflows-lab/{filename}.yml@{ref}
|
|
272
|
+
* - {owner}/{repo}/.github/workflows-lab/{filename}.yaml@{ref}
|
|
273
|
+
* - ./.github/workflows/{filename}.yml
|
|
274
|
+
* - ./.github/workflows/{filename}.yaml
|
|
275
|
+
* - ./.github/workflows-lab/{filename}.yml
|
|
276
|
+
* - ./.github/workflows-lab/{filename}.yaml
|
|
277
|
+
*/
|
|
278
|
+
function validateWorkflowUsesFormat(diagnostics, token) {
|
|
279
|
+
const uses = token.value;
|
|
280
|
+
// Local workflow reference
|
|
281
|
+
if (uses.startsWith("./.github/workflows/") || uses.startsWith("./.github/workflows-lab/")) {
|
|
282
|
+
// Cannot have @ version for local workflows
|
|
283
|
+
if (uses.includes("@")) {
|
|
284
|
+
addWorkflowUsesFormatError(diagnostics, token, "cannot specify version when calling local workflows");
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
// Must have .yml or .yaml extension
|
|
288
|
+
if (!uses.endsWith(".yml") && !uses.endsWith(".yaml")) {
|
|
289
|
+
addWorkflowUsesFormatError(diagnostics, token, "workflow file should have either a '.yml' or '.yaml' file extension");
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
// Must be at top level of .github/workflows/ or .github/workflows-lab/ (no subdirectories)
|
|
293
|
+
const pathParts = uses.split("/");
|
|
294
|
+
if (pathParts.length !== 4) {
|
|
295
|
+
// Expected: ".", ".github", "workflows" or "workflows-lab", "filename.yml"
|
|
296
|
+
addWorkflowUsesFormatError(diagnostics, token, "workflows must be defined at the top level of the .github/workflows/ directory");
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
// Filename cannot be just the extension
|
|
300
|
+
const filename = pathParts[3];
|
|
301
|
+
if (filename === ".yml" || filename === ".yaml") {
|
|
302
|
+
addWorkflowUsesFormatError(diagnostics, token, "invalid workflow file name");
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
// Malformed local workflow reference (starts with ./ but not in .github/workflows)
|
|
308
|
+
if (uses.startsWith("./")) {
|
|
309
|
+
addWorkflowUsesFormatError(diagnostics, token, "local workflow references must be rooted in '.github/workflows'");
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
// Remote workflow reference: must have @ for version
|
|
313
|
+
const atSegments = uses.split("@");
|
|
314
|
+
if (atSegments.length === 1) {
|
|
315
|
+
addWorkflowUsesFormatError(diagnostics, token, "no version specified");
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (atSegments.length > 2) {
|
|
319
|
+
addWorkflowUsesFormatError(diagnostics, token, "too many '@' in workflow reference");
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const [pathPart, version] = atSegments;
|
|
323
|
+
// Version cannot be empty
|
|
324
|
+
if (!version) {
|
|
325
|
+
addWorkflowUsesFormatError(diagnostics, token, "no version specified");
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
// Must contain .github/workflows or .github/workflows-lab path
|
|
329
|
+
const workflowsMatch = pathPart.match(/\.github\/workflows(-lab)?\//);
|
|
330
|
+
if (!workflowsMatch || workflowsMatch.index === undefined) {
|
|
331
|
+
addWorkflowUsesFormatError(diagnostics, token, "references to workflows must be rooted in '.github/workflows'");
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
// Split to get owner/repo and path
|
|
335
|
+
const pathIdx = workflowsMatch.index;
|
|
336
|
+
const nwoPart = pathPart.substring(0, pathIdx);
|
|
337
|
+
const workflowPath = pathPart.substring(pathIdx);
|
|
338
|
+
// Validate NWO part: must be owner/repo/
|
|
339
|
+
const nwoSegments = nwoPart.split("/").filter(s => s.length > 0);
|
|
340
|
+
if (nwoSegments.length !== 2) {
|
|
341
|
+
addWorkflowUsesFormatError(diagnostics, token, "references to workflows must be prefixed with format 'owner/repository/' or './' for local workflows");
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
// Validate owner and repo names
|
|
345
|
+
const [owner, repo] = nwoSegments;
|
|
346
|
+
const nwoError = validateNWO(owner, repo);
|
|
347
|
+
if (nwoError) {
|
|
348
|
+
addWorkflowUsesFormatError(diagnostics, token, nwoError);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
// Validate ref/version format
|
|
352
|
+
const refError = validateRefName(version);
|
|
353
|
+
if (refError) {
|
|
354
|
+
addWorkflowUsesFormatError(diagnostics, token, refError);
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
// Validate workflow path is at top level
|
|
358
|
+
const workflowPathParts = workflowPath.split("/");
|
|
359
|
+
if (workflowPathParts.length !== 3) {
|
|
360
|
+
// Expected: ".github", "workflows" or "workflows-lab", "filename.yml"
|
|
361
|
+
addWorkflowUsesFormatError(diagnostics, token, "workflows must be defined at the top level of the .github/workflows/ directory");
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
// Must have .yml or .yaml extension
|
|
365
|
+
const filename = workflowPathParts[2];
|
|
366
|
+
if (!filename.endsWith(".yml") && !filename.endsWith(".yaml")) {
|
|
367
|
+
addWorkflowUsesFormatError(diagnostics, token, "workflow file should have either a '.yml' or '.yaml' file extension");
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
// Filename cannot be just the extension
|
|
371
|
+
if (filename === ".yml" || filename === ".yaml") {
|
|
372
|
+
addWorkflowUsesFormatError(diagnostics, token, "invalid workflow file name");
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
function addWorkflowUsesFormatError(diagnostics, token, reason) {
|
|
377
|
+
diagnostics.push({
|
|
378
|
+
message: `Invalid workflow reference '${token.value}': ${reason}`,
|
|
379
|
+
severity: DiagnosticSeverity.Error,
|
|
380
|
+
range: mapRange(token.range),
|
|
381
|
+
code: "invalid-workflow-uses-format"
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Validates the git ref/version format.
|
|
386
|
+
* Based on Launch's ValidateRefName function.
|
|
387
|
+
*/
|
|
388
|
+
function validateRefName(refname) {
|
|
389
|
+
if (refname.length === 0) {
|
|
390
|
+
return "no version specified";
|
|
391
|
+
}
|
|
392
|
+
// Cannot be the single character '@'
|
|
393
|
+
if (refname === "@") {
|
|
394
|
+
return "version cannot be the single character '@'";
|
|
395
|
+
}
|
|
396
|
+
// Cannot have certain invalid characters or sequences
|
|
397
|
+
const invalidSequences = ["?", "*", "[", "]", "\\", "~", "^", ":", "@{", "..", "//"];
|
|
398
|
+
for (const seq of invalidSequences) {
|
|
399
|
+
if (refname.includes(seq)) {
|
|
400
|
+
return `invalid character '${seq}' in version`;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
// Cannot begin or end with a slash '/' or a dot '.'
|
|
404
|
+
if (refname.startsWith("/") || refname.endsWith("/") || refname.startsWith(".") || refname.endsWith(".")) {
|
|
405
|
+
return "version cannot begin or end with a slash '/' or a dot '.'";
|
|
406
|
+
}
|
|
407
|
+
// No slash-separated component can begin with a dot '.' or end with the sequence '.lock'
|
|
408
|
+
const components = refname.split("/");
|
|
409
|
+
for (const component of components) {
|
|
410
|
+
if (component.startsWith(".") || component.endsWith(".lock")) {
|
|
411
|
+
return `invalid version: ${refname}`;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
// No ASCII control characters or whitespace
|
|
415
|
+
// eslint-disable-next-line no-control-regex
|
|
416
|
+
if (/[\x00-\x1f\x7f]/.test(refname)) {
|
|
417
|
+
return "version cannot have ASCII control characters";
|
|
418
|
+
}
|
|
419
|
+
if (/\s/.test(refname)) {
|
|
420
|
+
return "version cannot have whitespace";
|
|
421
|
+
}
|
|
422
|
+
return undefined;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Validates owner and repository names.
|
|
426
|
+
* Based on Launch's ValidateNWO function.
|
|
427
|
+
*/
|
|
428
|
+
function validateNWO(owner, repo) {
|
|
429
|
+
// Owner name: can have word chars, dots, and hyphens
|
|
430
|
+
// \w in JS regex is [a-zA-Z0-9_]
|
|
431
|
+
if (!/^[\w.-]+$/.test(owner)) {
|
|
432
|
+
return "owner name must be a valid repository owner name";
|
|
433
|
+
}
|
|
434
|
+
// Repository name: can have word chars, dots, and hyphens
|
|
435
|
+
if (!/^[\w.-]+$/.test(repo)) {
|
|
436
|
+
return "repository name is invalid";
|
|
437
|
+
}
|
|
438
|
+
return undefined;
|
|
439
|
+
}
|
|
116
440
|
function getProviderContext(documentUri, template, root, tokenRange) {
|
|
117
441
|
const { path } = findToken({
|
|
118
442
|
line: tokenRange.start.line - 1,
|
|
@@ -120,10 +444,84 @@ function getProviderContext(documentUri, template, root, tokenRange) {
|
|
|
120
444
|
}, root);
|
|
121
445
|
return getWorkflowContext(documentUri, template, path);
|
|
122
446
|
}
|
|
123
|
-
|
|
447
|
+
/**
|
|
448
|
+
* Checks if a format function contains literal text in its format string.
|
|
449
|
+
* This indicates user confusion about how expressions work.
|
|
450
|
+
*
|
|
451
|
+
* Example: format('push == {0}', github.event_name)
|
|
452
|
+
* The literal text "push == " will always evaluate to truthy.
|
|
453
|
+
*
|
|
454
|
+
* @param expr The expression to check
|
|
455
|
+
* @returns true if the expression is a format() call with literal text
|
|
456
|
+
*/
|
|
457
|
+
function hasFormatWithLiteralText(expr) {
|
|
458
|
+
// If this is a logical AND expression (from ensureStatusFunction wrapping)
|
|
459
|
+
// check the right side for the format call
|
|
460
|
+
if (expr instanceof Logical && expr.operator.lexeme === "&&" && expr.args.length === 2) {
|
|
461
|
+
return hasFormatWithLiteralText(expr.args[1]);
|
|
462
|
+
}
|
|
463
|
+
if (!(expr instanceof FunctionCall)) {
|
|
464
|
+
return false;
|
|
465
|
+
}
|
|
466
|
+
// Check if this is a format function
|
|
467
|
+
if (expr.functionName.lexeme.toLowerCase() !== "format") {
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
// Check if the first argument is a string literal
|
|
471
|
+
if (expr.args.length < 1) {
|
|
472
|
+
return false;
|
|
473
|
+
}
|
|
474
|
+
const firstArg = expr.args[0];
|
|
475
|
+
if (!(firstArg instanceof Literal) || firstArg.literal.kind !== data.Kind.String) {
|
|
476
|
+
return false;
|
|
477
|
+
}
|
|
478
|
+
// Get the format string and trim whitespace
|
|
479
|
+
const formatString = firstArg.literal.coerceString();
|
|
480
|
+
const trimmed = formatString.trim();
|
|
481
|
+
// Check if there's literal text (non-replacement tokens) after trimming
|
|
482
|
+
let inToken = false;
|
|
483
|
+
for (let i = 0; i < trimmed.length; i++) {
|
|
484
|
+
if (!inToken && trimmed[i] === "{") {
|
|
485
|
+
inToken = true;
|
|
486
|
+
}
|
|
487
|
+
else if (inToken && trimmed[i] === "}") {
|
|
488
|
+
inToken = false;
|
|
489
|
+
}
|
|
490
|
+
else if (inToken && trimmed[i] >= "0" && trimmed[i] <= "9") {
|
|
491
|
+
// OK - this is a replacement token like {0}, {1}, etc.
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
// Found literal text
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return false;
|
|
499
|
+
}
|
|
500
|
+
async function validateExpression(diagnostics, token, allowedContext, contextProviderConfig, workflowContext, keyDefinitionKey) {
|
|
501
|
+
const { namedContexts, functions } = splitAllowedContext(allowedContext);
|
|
502
|
+
// Check for literal text in if condition
|
|
503
|
+
const definitionKey = keyDefinitionKey || token.definitionInfo?.definition?.key;
|
|
504
|
+
if (definitionKey === "job-if" || definitionKey === "step-if" || definitionKey === "snapshot-if") {
|
|
505
|
+
try {
|
|
506
|
+
const l = new Lexer(token.expression);
|
|
507
|
+
const lr = l.lex();
|
|
508
|
+
const p = new Parser(lr.tokens, namedContexts, functions);
|
|
509
|
+
const expr = p.parse();
|
|
510
|
+
if (hasFormatWithLiteralText(expr)) {
|
|
511
|
+
diagnostics.push({
|
|
512
|
+
message: "Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?",
|
|
513
|
+
range: mapRange(token.range),
|
|
514
|
+
severity: DiagnosticSeverity.Error,
|
|
515
|
+
code: "expression-literal-text-in-condition"
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
catch {
|
|
520
|
+
// Ignore parse errors here
|
|
521
|
+
}
|
|
522
|
+
}
|
|
124
523
|
// Validate the expression
|
|
125
524
|
for (const expression of token.originalExpressions || [token]) {
|
|
126
|
-
const { namedContexts, functions } = splitAllowedContext(allowedContext);
|
|
127
525
|
let expr;
|
|
128
526
|
try {
|
|
129
527
|
const l = new Lexer(expression.expression);
|
package/dist/validate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAwC,iBAAiB,EAAE,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAC5G,OAAO,EAAC,WAAW,EAAC,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAC,mBAAmB,EAAC,MAAM,oDAAoD,CAAC;AAGvF,OAAO,EAAC,aAAa,EAAC,MAAM,0DAA0D,CAAC;AAKvF,OAAO,EAAa,kBAAkB,EAAM,MAAM,6BAA6B,CAAC;AAGhF,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAkB,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAC,cAAc,EAAC,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAC,mBAAmB,EAAC,MAAM,mC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AAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actions/languageservice",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "Language service for GitHub Actions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"watch": "tsc --build tsconfig.build.json --watch"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@actions/expressions": "^0.3.
|
|
48
|
-
"@actions/workflow-parser": "^0.3.
|
|
47
|
+
"@actions/expressions": "^0.3.21",
|
|
48
|
+
"@actions/workflow-parser": "^0.3.21",
|
|
49
49
|
"vscode-languageserver-textdocument": "^1.0.7",
|
|
50
50
|
"vscode-languageserver-types": "^3.17.2",
|
|
51
51
|
"vscode-uri": "^3.0.8",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"ts-node": "^10.9.1",
|
|
74
74
|
"typescript": "^4.8.4"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "dfb411f71ec51c5a6ff9c7278efb65ba572a1f7a"
|
|
77
77
|
}
|