mirror of
https://github.com/github/codeql-action.git
synced 2026-05-16 16:20:21 +00:00
Util for optional/required inputs
This commit is contained in:
Generated
+21
-1
@@ -215,7 +215,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
||||
if (status === "success" || status === "failure" || status === "aborted") {
|
||||
statusReport.completed_at = new Date().toISOString();
|
||||
}
|
||||
const matrix = core.getInput("matrix");
|
||||
const matrix = getOptionalInput("matrix");
|
||||
if (matrix) {
|
||||
statusReport.matrix_vars = matrix;
|
||||
}
|
||||
@@ -383,4 +383,24 @@ function getCodeQLDatabasePath(tempDir, language) {
|
||||
return path.resolve(getCodeQLDatabasesDir(tempDir), language);
|
||||
}
|
||||
exports.getCodeQLDatabasePath = getCodeQLDatabasePath;
|
||||
/**
|
||||
* Wrapper for core.getInput. Returns undefined if the requested
|
||||
* input is not specified.
|
||||
*/
|
||||
function getOptionalInput(name) {
|
||||
const value = core.getInput(name);
|
||||
if (value === "") {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
exports.getOptionalInput = getOptionalInput;
|
||||
/**
|
||||
* Wrapper for core.getInput. Returns the requested input or
|
||||
* throws if not defined.
|
||||
*/
|
||||
function getRequiredInput(name) {
|
||||
return core.getInput(name, { required: true });
|
||||
}
|
||||
exports.getRequiredInput = getRequiredInput;
|
||||
//# sourceMappingURL=util.js.map
|
||||
Reference in New Issue
Block a user