Skip to content

Commit 1d71ea8

Browse files
committed
Add getState to ActionsEnv
1 parent 8ffc496 commit 1d71ea8

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎lib/entry-points.js‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/actions-util.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface ActionsEnv {
3131
getRequiredInput: (name: string) => string;
3232
getOptionalInput: (name: string) => string | undefined;
3333
setFailed: (message: string) => void;
34+
getState: (name: string) => string;
3435
}
3536

3637
/**
@@ -41,6 +42,7 @@ export function getActionsEnv(): ActionsEnv {
4142
getRequiredInput,
4243
getOptionalInput,
4344
setFailed: core.setFailed,
45+
getState: core.getState,
4446
};
4547
}
4648

‎src/testing-utils.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ class TestActionsEnv implements ActionsEnv {
255255
get hasFailed() {
256256
return this.failed;
257257
}
258+
259+
public getState(name: string): string {
260+
throw new Error(`State '${name}' requested but not set.`);
261+
}
258262
}
259263

260264
/**

0 commit comments

Comments
 (0)