Skip to content

Commit d4bfd40

Browse files
committed
Use .push rather than .concat
1 parent 82ce313 commit d4bfd40

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

lib/debug-artifacts.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/debug-artifacts.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/debug-artifacts.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function uploadAllAvailableDebugArtifacts(
2828
config: Config,
2929
logger: Logger,
3030
) {
31-
let filesToUpload: string[] = [];
31+
const filesToUpload: string[] = [];
3232

3333
const analyzeActionOutputDir = process.env[EnvVar.SARIF_RESULTS_OUTPUT_DIR];
3434
for (const lang of config.languages) {
@@ -46,15 +46,15 @@ export async function uploadAllAvailableDebugArtifacts(
4646
`${lang}.sarif`,
4747
);
4848
fs.renameSync(sarifFile, sarifInDbLocation);
49-
filesToUpload = filesToUpload.concat(sarifInDbLocation);
49+
filesToUpload.push(sarifInDbLocation);
5050
}
5151
}
5252

5353
// Add any log files
5454
const databaseDirectory = getCodeQLDatabasePath(config, lang);
5555
const logsDirectory = path.resolve(databaseDirectory, "log");
5656
if (doesDirectoryExist(logsDirectory)) {
57-
filesToUpload = filesToUpload.concat(listFolder(logsDirectory));
57+
filesToUpload.push(...listFolder(logsDirectory));
5858
}
5959

6060
// Multilanguage tracing: there are additional logs in the root of the cluster
@@ -63,9 +63,7 @@ export async function uploadAllAvailableDebugArtifacts(
6363
"log",
6464
);
6565
if (doesDirectoryExist(multiLanguageTracingLogsDirectory)) {
66-
filesToUpload = filesToUpload.concat(
67-
listFolder(multiLanguageTracingLogsDirectory),
68-
);
66+
filesToUpload.push(...listFolder(multiLanguageTracingLogsDirectory));
6967
}
7068

7169
// Add database bundle
@@ -75,7 +73,7 @@ export async function uploadAllAvailableDebugArtifacts(
7573
} else {
7674
databaseBundlePath = await createDatabaseBundleCli(config, lang);
7775
}
78-
filesToUpload = filesToUpload.concat(databaseBundlePath);
76+
filesToUpload.push(databaseBundlePath);
7977
}
8078

8179
await uploadDebugArtifacts(

0 commit comments

Comments
 (0)