@@ -151,17 +151,19 @@ async function run() {
151
151
152
152
if ( config . debugMode ) {
153
153
// Upload the logs as an Actions artifact for debugging
154
- const toUpload : string [ ] = [ ] ;
154
+ let toUpload : string [ ] = [ ] ;
155
155
for ( const language of config . languages ) {
156
- toUpload . push (
157
- ... listFolder (
156
+ toUpload = toUpload . concat (
157
+ listFolder (
158
158
path . resolve ( util . getCodeQLDatabasePath ( config , language ) , "log" )
159
159
)
160
160
) ;
161
161
}
162
162
if ( await codeQlVersionAbove ( codeql , CODEQL_VERSION_NEW_TRACING ) ) {
163
163
// Multilanguage tracing: there are additional logs in the root of the cluster
164
- toUpload . push ( ...listFolder ( path . resolve ( config . dbLocation , "log" ) ) ) ;
164
+ toUpload = toUpload . concat (
165
+ listFolder ( path . resolve ( config . dbLocation , "log" ) )
166
+ ) ;
165
167
}
166
168
await uploadDebugArtifacts (
167
169
toUpload ,
@@ -319,12 +321,12 @@ async function uploadDebugArtifacts(
319
321
320
322
function listFolder ( dir : string ) : string [ ] {
321
323
const entries = fs . readdirSync ( dir , { withFileTypes : true } ) ;
322
- const files : string [ ] = [ ] ;
324
+ let files : string [ ] = [ ] ;
323
325
for ( const entry of entries ) {
324
326
if ( entry . isFile ( ) ) {
325
327
files . push ( path . resolve ( dir , entry . name ) ) ;
326
328
} else if ( entry . isDirectory ( ) ) {
327
- files . push ( ... listFolder ( path . resolve ( dir , entry . name ) ) ) ;
329
+ files = files . concat ( listFolder ( path . resolve ( dir , entry . name ) ) ) ;
328
330
}
329
331
}
330
332
return files ;
0 commit comments