diff --git a/src/action-common.ts b/src/action-common.ts index eb120d357..5291e31b8 100644 --- a/src/action-common.ts +++ b/src/action-common.ts @@ -6,6 +6,7 @@ import { ActionsEnv, getActionsEnv } from "./actions-util"; import type { ApiClient } from "./api-client"; import { Env, ReadOnlyEnv } from "./environment"; import type { FeatureEnablement } from "./feature-flags"; +import type { FileSystem } from "./fs"; import { getActionsLogger, Logger } from "./logging"; import { ActionName, @@ -57,6 +58,10 @@ export interface FeatureState { /** Information about enabled feature flags. */ features: FeatureEnablement; }; + FS: { + /** The file system operations to use. */ + fs: FileSystem; + }; } /** Identifies a type of state an Action may have. */ diff --git a/src/testing-utils.ts b/src/testing-utils.ts index e8d3db706..d8c149329 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -1,3 +1,4 @@ +import * as fs from "fs"; import { TextDecoder } from "node:util"; import * as os from "os"; import path from "path"; @@ -226,6 +227,7 @@ type AllState = [ "Actions", "Api", "FeatureFlags", + "FS", ]; /** Initialise a fresh `ActionState` value. */ @@ -244,6 +246,7 @@ export function initAllState( actions: getTestActionsEnv(env), apiClient: github.getOctokit("123"), features: createFeatures([]), + fs, ...overrides, }; }