mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Add getRequiredInput to ActionsEnv
This commit is contained in:
2
lib/entry-points.js
generated
2
lib/entry-points.js
generated
@@ -145383,7 +145383,7 @@ var Failure = class {
|
||||
|
||||
// src/actions-util.ts
|
||||
function getActionsEnv() {
|
||||
return { getOptionalInput };
|
||||
return { getRequiredInput, getOptionalInput };
|
||||
}
|
||||
var getRequiredInput = function(name) {
|
||||
const value = core3.getInput(name);
|
||||
|
||||
@@ -27,6 +27,7 @@ declare const __CODEQL_ACTION_VERSION__: string;
|
||||
* global functions in tests.
|
||||
*/
|
||||
export interface ActionsEnv {
|
||||
getRequiredInput: (name: string) => string;
|
||||
getOptionalInput: (name: string) => string | undefined;
|
||||
}
|
||||
|
||||
@@ -34,7 +35,7 @@ export interface ActionsEnv {
|
||||
* Gets the real `ActionsEnv` used by production code.
|
||||
*/
|
||||
export function getActionsEnv(): ActionsEnv {
|
||||
return { getOptionalInput };
|
||||
return { getRequiredInput, getOptionalInput };
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -187,6 +187,9 @@ export function getTestEnv(testEnv: NodeJS.ProcessEnv = {}): Env {
|
||||
*/
|
||||
export function getTestActionsEnv(): ActionsEnv {
|
||||
return {
|
||||
getRequiredInput: (name) => {
|
||||
throw new Error(`Input required and not supplied: ${name}`);
|
||||
},
|
||||
getOptionalInput: () => undefined,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user