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
|
// src/actions-util.ts
|
||||||
function getActionsEnv() {
|
function getActionsEnv() {
|
||||||
return { getOptionalInput };
|
return { getRequiredInput, getOptionalInput };
|
||||||
}
|
}
|
||||||
var getRequiredInput = function(name) {
|
var getRequiredInput = function(name) {
|
||||||
const value = core3.getInput(name);
|
const value = core3.getInput(name);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ declare const __CODEQL_ACTION_VERSION__: string;
|
|||||||
* global functions in tests.
|
* global functions in tests.
|
||||||
*/
|
*/
|
||||||
export interface ActionsEnv {
|
export interface ActionsEnv {
|
||||||
|
getRequiredInput: (name: string) => string;
|
||||||
getOptionalInput: (name: string) => string | undefined;
|
getOptionalInput: (name: string) => string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ export interface ActionsEnv {
|
|||||||
* Gets the real `ActionsEnv` used by production code.
|
* Gets the real `ActionsEnv` used by production code.
|
||||||
*/
|
*/
|
||||||
export function getActionsEnv(): ActionsEnv {
|
export function getActionsEnv(): ActionsEnv {
|
||||||
return { getOptionalInput };
|
return { getRequiredInput, getOptionalInput };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -187,6 +187,9 @@ export function getTestEnv(testEnv: NodeJS.ProcessEnv = {}): Env {
|
|||||||
*/
|
*/
|
||||||
export function getTestActionsEnv(): ActionsEnv {
|
export function getTestActionsEnv(): ActionsEnv {
|
||||||
return {
|
return {
|
||||||
|
getRequiredInput: (name) => {
|
||||||
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
|
},
|
||||||
getOptionalInput: () => undefined,
|
getOptionalInput: () => undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user