@@ -342,14 +342,17 @@ class GithubApi {
342342 fileNameOnly = utils . getFileName ( fileNameOnly ) ;
343343
344344 // ignore blank file, file out of src folder, cached file
345- if ( utils . isBlank ( fileNameOnly ) || utils . isBlank ( filedir ) || ! filedir . startsWith ( 'src/' ) || self . cacheFiles . indexOf ( fileName ) >= 0 ) {
345+ if ( utils . isBlank ( fileNameOnly ) || utils . isBlank ( filedir ) ||
346+ ( ! filedir . startsWith ( 'src/' ) && fileName != 'src/package.xml' ) ||
347+ self . cacheFiles . indexOf ( fileName ) >= 0 ) {
346348 self . logger ( ' > ' + file . path + ' (Ignored)' ) ;
347349 return callback ( null ) ;
348350 }
349351 self . cacheFiles . push ( fileName ) ;
350-
351352 const localPath = metadata . makeDir ( self . pipeline . id , fileName )
352- const fileContentUri = path . join ( 'repos' , repos . __fullname , 'contents' , file . path ) ;
353+ const filePath = file . path . replace ( new RegExp ( fileNameOnly , 'g' ) , encodeURIComponent ( fileNameOnly ) ) ;
354+ const fileContentUri = path . join ( 'repos' , repos . __fullname , 'contents' , filePath ) ;
355+
353356 self . fileApiCall ( fileContentUri , { ref : branchName } )
354357 . then ( function ( response ) {
355358 if ( utils . isBlank ( response . status ) || response . status != 200 ) {
@@ -429,7 +432,9 @@ class GithubApi {
429432 let filedir = path . dirname ( fileName ) ;
430433 fileNameOnly = utils . getFileName ( fileNameOnly ) ;
431434 // ignore blank file, file out of src folder, cached file
432- if ( utils . isBlank ( fileNameOnly ) || utils . isBlank ( filedir ) || ! filedir . startsWith ( 'src/' ) || self . cacheFiles . indexOf ( fileName ) >= 0 ) {
435+ if ( utils . isBlank ( fileNameOnly ) || utils . isBlank ( filedir ) ||
436+ ( ! filedir . startsWith ( 'src/' ) && fileName != 'src/package.xml' ) ||
437+ self . cacheFiles . indexOf ( fileName ) >= 0 ) {
433438 self . logger ( ' > ' + file . filename + ' (Ignored)' ) ;
434439 return callback ( null ) ;
435440 }
0 commit comments