Make FS available to init

This commit is contained in:
Michael B. Gale
2026-10-09 19:42:41 +01:00
parent e6f5465b76
commit 149926c8cd
3 changed files with 385 additions and 381 deletions

760
lib/entry-points.js generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,4 @@
import * as fs from "fs";
import * as os from "os";
import * as core from "@actions/core";
@@ -83,7 +84,7 @@ export type ActionState<Fs extends readonly StateFeature[]> = FieldsOf<Fs>;
* Each Action can then augment the `state` further if additional features are required.
*/
export type ActionMain = (
state: ActionState<["Base", "Logger", "Env", "Actions"]>,
state: ActionState<["Base", "FS", "Logger", "Env", "Actions"]>,
) => Promise<void>;
/** A specification for a CodeQL Action step. */
@@ -114,6 +115,7 @@ export async function runInActions(action: Action) {
platform: process.platform,
arch: process.arch,
osRelease: os.release(),
fs,
logger,
env,
actions: actionsEnv,

View File

@@ -199,7 +199,7 @@ async function sendCompletedStatusReport(
}
async function run(
actionState: ActionState<["Base", "Logger", "Env", "Actions"]>,
actionState: ActionState<["Base", "Logger", "Env", "Actions", "FS"]>,
) {
// To capture errors appropriately, keep as much code within the try-catch as
// possible, and only use safe functions outside.