Add secrets, variables, and inputs to storage

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-10-20 18:55:28 -04:00
parent 524a724279
commit 551f6baa2f
18 changed files with 226 additions and 188 deletions

View File

@@ -1,5 +1,6 @@
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
import { act } from "../../extension";
import { StorageKey } from "../../storageManager";
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
import InputTreeItem from "./input";
@@ -13,8 +14,13 @@ export default class InputsTreeItem extends TreeItem implements GithubLocalActio
}
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
const workflows = await act.workflowsManager.getWorkflows(this.workspaceFolder);
const inputs = [...new Set(workflows.map(workflow => act.settingsManager.getInputs(workflow)).flat())];
return inputs.map(input => new InputTreeItem(this.workspaceFolder, input));
const items: GithubLocalActionsTreeItem[] = [];
const inputs = await act.settingsManager.getSetting(this.workspaceFolder, /\${{\s*(?:inputs|github\.event\.inputs)\.(.*?)(?:\s*==\s*(.*?))?\s*}}/g, StorageKey.Inputs);
for (const input of inputs) {
items.push(new InputTreeItem(this.workspaceFolder, input));
}
return items;
}
}