mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Add function for retrieving the "upload" input
This commit is contained in:
@@ -12,6 +12,7 @@ inputs:
|
|||||||
upload:
|
upload:
|
||||||
description: Upload the SARIF file to Code Scanning
|
description: Upload the SARIF file to Code Scanning
|
||||||
required: false
|
required: false
|
||||||
|
# If changing this, make sure to update workflow.ts accordingly.
|
||||||
default: "true"
|
default: "true"
|
||||||
cleanup-level:
|
cleanup-level:
|
||||||
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
|
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
|
||||||
|
|||||||
14
lib/workflow.js
generated
14
lib/workflow.js
generated
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getCategoryInputOrThrow = exports.getStepsCallingAction = exports.getWorkflowRunID = exports.getWorkflowPath = exports.getWorkflow = exports.formatWorkflowCause = exports.formatWorkflowErrors = exports.validateWorkflow = exports.getWorkflowErrors = exports.WorkflowErrors = exports.patternIsSuperset = void 0;
|
exports.getUploadInputOrThrow = exports.getCategoryInputOrThrow = exports.getStepsCallingAction = exports.getWorkflowRunID = exports.getWorkflowPath = exports.getWorkflow = exports.formatWorkflowCause = exports.formatWorkflowErrors = exports.validateWorkflow = exports.getWorkflowErrors = exports.WorkflowErrors = exports.patternIsSuperset = void 0;
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
const core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
@@ -302,4 +302,16 @@ function getCategoryInputOrThrow(workflow, jobName, matrixVars) {
|
|||||||
return getInputOrThrow(workflow, jobName, "github/codeql-action/analyze", "category", matrixVars);
|
return getInputOrThrow(workflow, jobName, "github/codeql-action/analyze", "category", matrixVars);
|
||||||
}
|
}
|
||||||
exports.getCategoryInputOrThrow = getCategoryInputOrThrow;
|
exports.getCategoryInputOrThrow = getCategoryInputOrThrow;
|
||||||
|
/**
|
||||||
|
* Makes a best effort attempt to retrieve the upload input for the particular job,
|
||||||
|
* given a set of matrix variables.
|
||||||
|
*
|
||||||
|
* @returns the upload input
|
||||||
|
* @throws an error if the upload input could not be determined
|
||||||
|
*/
|
||||||
|
function getUploadInputOrThrow(workflow, jobName, matrixVars) {
|
||||||
|
return (getInputOrThrow(workflow, jobName, "github/codeql-action/analyze", "upload", matrixVars) || "true" // if unspecified, upload defaults to true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
exports.getUploadInputOrThrow = getUploadInputOrThrow;
|
||||||
//# sourceMappingURL=workflow.js.map
|
//# sourceMappingURL=workflow.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -382,3 +382,26 @@ export function getCategoryInputOrThrow(
|
|||||||
matrixVars
|
matrixVars
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes a best effort attempt to retrieve the upload input for the particular job,
|
||||||
|
* given a set of matrix variables.
|
||||||
|
*
|
||||||
|
* @returns the upload input
|
||||||
|
* @throws an error if the upload input could not be determined
|
||||||
|
*/
|
||||||
|
export function getUploadInputOrThrow(
|
||||||
|
workflow: Workflow,
|
||||||
|
jobName: string,
|
||||||
|
matrixVars: { [key: string]: string }
|
||||||
|
): string {
|
||||||
|
return (
|
||||||
|
getInputOrThrow(
|
||||||
|
workflow,
|
||||||
|
jobName,
|
||||||
|
"github/codeql-action/analyze",
|
||||||
|
"upload",
|
||||||
|
matrixVars
|
||||||
|
) || "true" // if unspecified, upload defaults to true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user