Add getState to ActionsEnv

This commit is contained in:
Michael B. Gale
2026-10-19 20:06:11 +01:00
parent 62b501ded0
commit 575c0d4d37
3 changed files with 8 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ export interface ActionsEnv {
getRequiredInput: (name: string) => string;
getOptionalInput: (name: string) => string | undefined;
setFailed: (message: string) => void;
getState: (name: string) => string;
}
/**
@@ -41,6 +42,7 @@ export function getActionsEnv(): ActionsEnv {
getRequiredInput,
getOptionalInput,
setFailed: core.setFailed,
getState: core.getState,
};
}

View File

@@ -255,6 +255,10 @@ class TestActionsEnv implements ActionsEnv {
get hasFailed() {
return this.failed;
}
public getState(name: string): string {
throw new Error(`State '${name}' requested but not set.`);
}
}
/**