Use .push rather than .concat
This commit is contained in:
parent
82ce3131fa
commit
d4bfd40513
3 changed files with 11 additions and 13 deletions
10
lib/debug-artifacts.js
generated
10
lib/debug-artifacts.js
generated
|
|
@ -44,7 +44,7 @@ function sanitizeArifactName(name) {
|
|||
return name.replace(/[^a-zA-Z0-9_\\-]+/g, "");
|
||||
}
|
||||
async function uploadAllAvailableDebugArtifacts(config, logger) {
|
||||
let filesToUpload = [];
|
||||
const filesToUpload = [];
|
||||
const analyzeActionOutputDir = process.env[environment_1.EnvVar.SARIF_RESULTS_OUTPUT_DIR];
|
||||
for (const lang of config.languages) {
|
||||
// Add any SARIF files, if they exist
|
||||
|
|
@ -56,19 +56,19 @@ async function uploadAllAvailableDebugArtifacts(config, logger) {
|
|||
if (fs.existsSync(sarifFile)) {
|
||||
const sarifInDbLocation = path.resolve(config.dbLocation, `${lang}.sarif`);
|
||||
fs.renameSync(sarifFile, sarifInDbLocation);
|
||||
filesToUpload = filesToUpload.concat(sarifInDbLocation);
|
||||
filesToUpload.push(sarifInDbLocation);
|
||||
}
|
||||
}
|
||||
// Add any log files
|
||||
const databaseDirectory = (0, util_1.getCodeQLDatabasePath)(config, lang);
|
||||
const logsDirectory = path.resolve(databaseDirectory, "log");
|
||||
if ((0, util_1.doesDirectoryExist)(logsDirectory)) {
|
||||
filesToUpload = filesToUpload.concat((0, util_1.listFolder)(logsDirectory));
|
||||
filesToUpload.push(...(0, util_1.listFolder)(logsDirectory));
|
||||
}
|
||||
// Multilanguage tracing: there are additional logs in the root of the cluster
|
||||
const multiLanguageTracingLogsDirectory = path.resolve(config.dbLocation, "log");
|
||||
if ((0, util_1.doesDirectoryExist)(multiLanguageTracingLogsDirectory)) {
|
||||
filesToUpload = filesToUpload.concat((0, util_1.listFolder)(multiLanguageTracingLogsDirectory));
|
||||
filesToUpload.push(...(0, util_1.listFolder)(multiLanguageTracingLogsDirectory));
|
||||
}
|
||||
// Add database bundle
|
||||
let databaseBundlePath;
|
||||
|
|
@ -78,7 +78,7 @@ async function uploadAllAvailableDebugArtifacts(config, logger) {
|
|||
else {
|
||||
databaseBundlePath = await createDatabaseBundleCli(config, lang);
|
||||
}
|
||||
filesToUpload = filesToUpload.concat(databaseBundlePath);
|
||||
filesToUpload.push(databaseBundlePath);
|
||||
}
|
||||
await uploadDebugArtifacts(filesToUpload, config.dbLocation, config.debugArtifactName);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue