Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use .push rather than .concat
  • Loading branch information
angelapwen committed Sep 11, 2024
commit d4bfd4051319fc1685629e50c0cd9647dc4cf26c
10 changes: 5 additions & 5 deletions lib/debug-artifacts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/debug-artifacts.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions src/debug-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function uploadAllAvailableDebugArtifacts(
config: Config,
logger: Logger,
) {
let filesToUpload: string[] = [];
const filesToUpload: string[] = [];

const analyzeActionOutputDir = process.env[EnvVar.SARIF_RESULTS_OUTPUT_DIR];
for (const lang of config.languages) {
Expand All @@ -46,15 +46,15 @@ export async function uploadAllAvailableDebugArtifacts(
`${lang}.sarif`,
);
fs.renameSync(sarifFile, sarifInDbLocation);
Comment thread
henrymercer marked this conversation as resolved.
Outdated
filesToUpload = filesToUpload.concat(sarifInDbLocation);
filesToUpload.push(sarifInDbLocation);
}
}

// Add any log files
const databaseDirectory = getCodeQLDatabasePath(config, lang);
const logsDirectory = path.resolve(databaseDirectory, "log");
if (doesDirectoryExist(logsDirectory)) {
filesToUpload = filesToUpload.concat(listFolder(logsDirectory));
filesToUpload.push(...listFolder(logsDirectory));
}

// Multilanguage tracing: there are additional logs in the root of the cluster
Expand All @@ -63,9 +63,7 @@ export async function uploadAllAvailableDebugArtifacts(
"log",
);
if (doesDirectoryExist(multiLanguageTracingLogsDirectory)) {
filesToUpload = filesToUpload.concat(
listFolder(multiLanguageTracingLogsDirectory),
);
filesToUpload.push(...listFolder(multiLanguageTracingLogsDirectory));
}

// Add database bundle
Expand All @@ -75,7 +73,7 @@ export async function uploadAllAvailableDebugArtifacts(
} else {
databaseBundlePath = await createDatabaseBundleCli(config, lang);
}
filesToUpload = filesToUpload.concat(databaseBundlePath);
filesToUpload.push(databaseBundlePath);
}

await uploadDebugArtifacts(
Expand Down