Skip to content

Commit 436656b

Browse files
committed
Add FS state feature
1 parent 130da64 commit 436656b

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/action-common.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ActionsEnv, getActionsEnv } from "./actions-util";
66
import type { ApiClient } from "./api-client";
77
import { Env, ReadOnlyEnv } from "./environment";
88
import type { FeatureEnablement } from "./feature-flags";
9+
import type { FileSystem } from "./fs";
910
import { getActionsLogger, Logger } from "./logging";
1011
import {
1112
ActionName,
@@ -57,6 +58,10 @@ export interface FeatureState {
5758
/** Information about enabled feature flags. */
5859
features: FeatureEnablement;
5960
};
61+
FS: {
62+
/** The file system operations to use. */
63+
fs: FileSystem;
64+
};
6065
}
6166

6267
/** Identifies a type of state an Action may have. */

‎src/testing-utils.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as fs from "fs";
12
import { TextDecoder } from "node:util";
23
import * as os from "os";
34
import path from "path";
@@ -226,6 +227,7 @@ type AllState = [
226227
"Actions",
227228
"Api",
228229
"FeatureFlags",
230+
"FS",
229231
];
230232

231233
/** Initialise a fresh `ActionState<AllState>` value. */
@@ -244,6 +246,7 @@ export function initAllState(
244246
actions: getTestActionsEnv(env),
245247
apiClient: github.getOctokit("123"),
246248
features: createFeatures([]),
249+
fs,
247250
...overrides,
248251
};
249252
}

0 commit comments

Comments
 (0)