Add getState to ActionsEnv

This commit is contained in:
Michael B. Gale
2026-10-19 20:06:11 +01:00
parent 938d1c591f
commit 84bd5a897c
3 changed files with 8 additions and 1 deletions

3
lib/entry-points.js generated
View File

@@ -170133,7 +170133,8 @@ function getActionsEnv() {
return {
getRequiredInput,
getOptionalInput,
setFailed: core4.setFailed
setFailed: core4.setFailed,
getState: core4.getState
};
}
var getRequiredInput = function(name) {

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.`);
}
}
/**