Split upload method into two mode-specific ones
This commit is contained in:
parent
7ae9b0db35
commit
57514f31db
12 changed files with 93 additions and 39 deletions
11
lib/analyze.js
generated
11
lib/analyze.js
generated
|
|
@ -129,7 +129,16 @@ async function runAnalyze(repositoryNwo, commitOid, ref, analysisKey, analysisNa
|
|||
logger.info("Not uploading results");
|
||||
return { ...queriesStats };
|
||||
}
|
||||
const uploadStats = await upload_lib.upload(outputDir, repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, apiDetails, mode, logger);
|
||||
let uploadStats;
|
||||
if (mode == "actions") {
|
||||
uploadStats = await upload_lib.uploadFromActions(outputDir, repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, apiDetails, logger);
|
||||
}
|
||||
else if (mode == "runner") {
|
||||
uploadStats = await upload_lib.uploadFromRunner(outputDir, repositoryNwo, commitOid, ref, checkoutPath, apiDetails, logger);
|
||||
}
|
||||
else {
|
||||
throw new Error(`Unknown mode "${mode}"`);
|
||||
}
|
||||
return { ...queriesStats, ...uploadStats };
|
||||
}
|
||||
exports.runAnalyze = runAnalyze;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue