From 7549e1e4b967bf5f827b32249ec181ba542de0f9 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Mon, 30 Oct 2023 16:18:54 -0600 Subject: [PATCH] fix: bug with order in which the files and files ignore patterns are combined (#1684) Co-authored-by: GitHub Action --- dist/index.js | Bin 2171207 -> 2171264 bytes dist/index.js.map | Bin 2542703 -> 2542761 bytes src/utils.ts | 46 +++++++++++++++++++++++++--------------------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/dist/index.js b/dist/index.js index a31870b2fb151b0b0c9d9d07b500db991668a7cd..440f3b8de923cfd13d4d6db710529dfe5e184c48 100644 GIT binary patch delta 228 zcmWm6yAHu%9ES1y)miI&EG?$5mfnEP6&OVf43$*mt7t7IgTx*9?t+M>-9#9~t+)ZJ z*YHc8>3Kc&w0nY2{z+o2A8s#ni;C%$WHAiLI0mH1HeYQ#*PPo+%N6evY3jc{Yi$f1 zXKBrN&s;b*H`s(T(Y=!%_Rchph|h@X2V5Wm5=0>eaY#TCQjmrW$e=(La*&4t6rluV Ys6Z8J@c%bJg(kE>10CAoFz9?2KlM{tMF0Q* delta 224 zcmWm4yAHts7>40|b*?(pv84`)J2Hu#gxK6b2Z@DE@=xLls6^8)U7RB6RhT3s>^7g_ zd8gMt&u}}2NK}~A;f!Dr_e`z~tt^fc4 diff --git a/dist/index.js.map b/dist/index.js.map index 1c02d7ecdb4452b28709b0efa172c5a880d2e6f4..f84fdd4d17e4cd5ed84a3bd2a246cef9a27a748a 100644 GIT binary patch delta 238 zcmW;DyAHu%7zW_9>T{|prOxL=V{rp+zzx`HBxxcd!QSCdY}TKM3owziQAtfUqrnxp z0JF^-!!tgg?Or(U_JYj>Cb9sNSkR@n6EKWEw;xpUUKhGc{Cp*upM2`_&4m=%n$1_s zMQ>tF#|!>-sLYi^L?^>EXGWJl)1>`}H*#qr^1+bW>zhvyf-poN3Ner&4hkedg(Rdv igEVA7hb-hE4+SVf3Cd7`D%7A34QN6O+TP9YIO-4n0Bl_V delta 245 zcmXZUyAHu{7>4n*_?)St&eWO34Y&cD$=1XsK~k5%@K0RAM_hqPQj!v8iNw%ZVlo=s zf>+{6e(SScZ=}y^BQ1m^WZ@ES;W^N2&vS>o(umI%<+*<+55Fy{r3_R5*O|=5W~*r! zX0zR8 => { - let filePatterns = inputs.files - .split(inputs.filesSeparator) - .filter(Boolean) - .join('\n') - - if (inputs.filesFromSourceFile !== '') { - const inputFilesFromSourceFile = inputs.filesFromSourceFile - .split(inputs.filesFromSourceFileSeparator) - .filter(p => p !== '') - .map(p => path.join(workingDirectory, p)) - - core.debug(`files from source file: ${inputFilesFromSourceFile}`) - - const filesFromSourceFiles = ( - await getFilesFromSourceFile({filePaths: inputFilesFromSourceFile}) - ).join('\n') - - core.debug(`files from source files patterns: ${filesFromSourceFiles}`) - - filePatterns = filePatterns.concat('\n', filesFromSourceFiles) - } + let filePatterns = '' if (inputs.filesIgnore) { const filesIgnorePatterns = inputs.filesIgnore @@ -1001,6 +981,30 @@ export const getFilePatterns = async ({ filePatterns = filePatterns.concat('\n', filesIgnoreFromSourceFiles) } + if (inputs.files) { + filePatterns = filePatterns.concat( + '\n', + inputs.files.split(inputs.filesSeparator).filter(Boolean).join('\n') + ) + } + + if (inputs.filesFromSourceFile !== '') { + const inputFilesFromSourceFile = inputs.filesFromSourceFile + .split(inputs.filesFromSourceFileSeparator) + .filter(p => p !== '') + .map(p => path.join(workingDirectory, p)) + + core.debug(`files from source file: ${inputFilesFromSourceFile}`) + + const filesFromSourceFiles = ( + await getFilesFromSourceFile({filePaths: inputFilesFromSourceFile}) + ).join('\n') + + core.debug(`files from source files patterns: ${filesFromSourceFiles}`) + + filePatterns = filePatterns.concat('\n', filesFromSourceFiles) + } + if (isWindows()) { filePatterns = filePatterns.replace(/\r\n/g, '\n') filePatterns = filePatterns.replace(/\r/g, '\n')