mirror of
https://github.com/github/codeql-action.git
synced 2026-11-09 06:29:52 +00:00
Add getState to ActionsEnv
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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.`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user