mirror of
https://github.com/github/codeql-action.git
synced 2026-11-08 14:09:51 +00:00
Allow getCheckoutPathInputOrThrow to get root from config
This commit is contained in:
29
lib/entry-points.js
generated
29
lib/entry-points.js
generated
@@ -162185,14 +162185,20 @@ function getUploadInputOrThrow(workflow, jobName, matrixVars) {
|
||||
matrixVars
|
||||
);
|
||||
}
|
||||
function getCheckoutPathInputOrThrow(workflow, jobName, matrixVars) {
|
||||
return getInputOrThrow(
|
||||
workflow,
|
||||
jobName,
|
||||
getAnalyzeActionName(),
|
||||
"checkout_path",
|
||||
matrixVars
|
||||
) || getRequiredEnvParam("GITHUB_WORKSPACE");
|
||||
function getRepositoryRootOrThrow(workflow, jobName, matrixVars, config, env = getEnv()) {
|
||||
return (
|
||||
// If the CodeQL Action already has a persisted repository root, then we can just use that.
|
||||
config.repositoryRoot ?? // Otherwise, try to retrieve it from a `checkout_path` input in the workflow specification.
|
||||
getInputOrThrow(
|
||||
workflow,
|
||||
jobName,
|
||||
getAnalyzeActionName(),
|
||||
"checkout_path",
|
||||
matrixVars
|
||||
) ?? // Finally, if all of the above fail, just use the value of `GITHUB_WORKSPACE` since that
|
||||
// is what is used by default.
|
||||
env.getRequired("GITHUB_WORKSPACE" /* GITHUB_WORKSPACE */)
|
||||
);
|
||||
}
|
||||
async function checkWorkflow(logger, codeql) {
|
||||
if (!isDynamicWorkflow() && process.env["CODEQL_ACTION_SKIP_WORKFLOW_VALIDATION" /* SKIP_WORKFLOW_VALIDATION */] !== "true") {
|
||||
@@ -162763,7 +162769,12 @@ async function prepareFailedSarif(logger, features, config) {
|
||||
});
|
||||
}
|
||||
const category = getCategoryInputOrThrow(workflow, jobName, matrix);
|
||||
const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix);
|
||||
const checkoutPath = getRepositoryRootOrThrow(
|
||||
workflow,
|
||||
jobName,
|
||||
matrix,
|
||||
config
|
||||
);
|
||||
const result = await generateFailedSarif(
|
||||
logger,
|
||||
features,
|
||||
|
||||
Reference in New Issue
Block a user