Complete reusable workflow secrets, handle placeholder key

This commit is contained in:
Beth Brennan
2023-03-01 12:57:36 -05:00
parent 437a4151e4
commit 381d04730e
8 changed files with 158 additions and 6 deletions
+12
View File
@@ -1,3 +1,6 @@
import {isString} from "@github/actions-workflow-parser";
import {StringToken} from "@github/actions-workflow-parser/templates/tokens/string-token";
import {TemplateToken} from "@github/actions-workflow-parser/templates/tokens/template-token";
import {Position, TextDocument} from "vscode-languageserver-textdocument";
import {Range} from "vscode-languageserver-types";
@@ -72,3 +75,12 @@ export function transform(doc: TextDocument, pos: Position): [TextDocument, Posi
return [newDoc, newDoc.positionAt(offset)];
}
// Detect placeholder key and value added by transform
export function isPlaceholder(key: StringToken, value: TemplateToken) {
if (key.value === PLACEHOLDER_KEY && isString(value) && value.value == "") {
return true;
}
return false;
}