mirror of
https://github.com/github/codeql-action.git
synced 2026-10-21 02:01:27 +00:00
Add FS state feature
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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<AllState>` value. */
|
||||
@@ -244,6 +246,7 @@ export function initAllState(
|
||||
actions: getTestActionsEnv(env),
|
||||
apiClient: github.getOctokit("123"),
|
||||
features: createFeatures([]),
|
||||
fs,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user