Use fetchActionMetadata to check action validity (#147)
This commit is contained in:
@@ -24,9 +24,9 @@ import {getFileProvider} from "./file-provider";
|
||||
import {InitializationOptions, RepositoryContext} from "./initializationOptions";
|
||||
import {onCompletion} from "./on-completion";
|
||||
import {ReadFileRequest, Requests} from "./request";
|
||||
import {fetchActionMetadata} from "./utils/action-metadata";
|
||||
import {TTLCache} from "./utils/cache";
|
||||
import {valueProviders} from "./value-providers";
|
||||
import {getActionInputs} from "./value-providers/action-inputs";
|
||||
|
||||
export function initConnection(connection: Connection) {
|
||||
const documents: TextDocuments<TextDocument> = new TextDocuments(TextDocument);
|
||||
@@ -102,9 +102,9 @@ export function initConnection(connection: Connection) {
|
||||
const config: ValidationConfig = {
|
||||
valueProviderConfig: valueProviders(client, repoContext, cache),
|
||||
contextProviderConfig: contextProviders(client, repoContext, cache),
|
||||
getActionInputs: async action => {
|
||||
fetchActionMetadata: async action => {
|
||||
if (client) {
|
||||
return await getActionInputs(client, cache, action);
|
||||
return await fetchActionMetadata(client, cache, action);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import {ActionReference, ActionInputs, ActionOutputs, actionIdentifier} from "@github/actions-languageservice/action";
|
||||
import {ActionReference, ActionMetadata, actionIdentifier} from "@github/actions-languageservice/action";
|
||||
import {error} from "@github/actions-languageservice/log";
|
||||
import {Octokit, RestEndpointMethodTypes} from "@octokit/rest";
|
||||
import {parse} from "yaml";
|
||||
import {TTLCache} from "./cache";
|
||||
|
||||
export type ActionMetadata = {
|
||||
inputs?: ActionInputs;
|
||||
outputs?: ActionOutputs;
|
||||
};
|
||||
|
||||
export async function fetchActionMetadata(
|
||||
client: Octokit,
|
||||
cache: TTLCache,
|
||||
|
||||
Reference in New Issue
Block a user