@@ -151,17 +151,19 @@ async function run() {
151151
152152 if ( config . debugMode ) {
153153 // Upload the logs as an Actions artifact for debugging
154- const toUpload : string [ ] = [ ] ;
154+ let toUpload : string [ ] = [ ] ;
155155 for ( const language of config . languages ) {
156- toUpload . push (
157- ... listFolder (
156+ toUpload = toUpload . concat (
157+ listFolder (
158158 path . resolve ( util . getCodeQLDatabasePath ( config , language ) , "log" )
159159 )
160160 ) ;
161161 }
162162 if ( await codeQlVersionAbove ( codeql , CODEQL_VERSION_NEW_TRACING ) ) {
163163 // 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+ ) ;
165167 }
166168 await uploadDebugArtifacts (
167169 toUpload ,
@@ -319,12 +321,12 @@ async function uploadDebugArtifacts(
319321
320322function listFolder ( dir : string ) : string [ ] {
321323 const entries = fs . readdirSync ( dir , { withFileTypes : true } ) ;
322- const files : string [ ] = [ ] ;
324+ let files : string [ ] = [ ] ;
323325 for ( const entry of entries ) {
324326 if ( entry . isFile ( ) ) {
325327 files . push ( path . resolve ( dir , entry . name ) ) ;
326328 } else if ( entry . isDirectory ( ) ) {
327- files . push ( ... listFolder ( path . resolve ( dir , entry . name ) ) ) ;
329+ files = files . concat ( listFolder ( path . resolve ( dir , entry . name ) ) ) ;
328330 }
329331 }
330332 return files ;
0 commit comments