@@ -145,7 +145,6 @@ jobs:
145
145
source ../configMatrix/configMatrix.sh
146
146
147
147
output_path="../outputs"
148
- output_file="$output_path/output.txt"
149
148
150
149
mkdir -p "$output_path"
151
150
@@ -155,6 +154,7 @@ jobs:
155
154
function copy_commit_diff(){
156
155
library_type=$1
157
156
language=$2
157
+ output_file="$output_path/$library_type-$language.txt"
158
158
159
159
path_prefix="../test/$library_type/$language"
160
160
target_path_new_version="$path_prefix/new-version"
@@ -211,15 +211,8 @@ jobs:
211
211
# Add output to file
212
212
# echo "[$library_type/$language](https://github.com/${{github.repository}}/compare/$old_version_commit_hash..$new_version_commit_hash)" >> "$output_file"
213
213
214
-
215
- # Add type to output file
216
- echo "${library_type} ${language}" >> $output_file
217
-
218
214
# Add changes to output file
219
215
git diff HEAD~ >> $output_file
220
-
221
- # Add empty line
222
- echo \ >> $output_file
223
216
fi
224
217
}
225
218
@@ -281,10 +274,6 @@ jobs:
281
274
script : |
282
275
const fs = require('fs');
283
276
284
- fs.readdirSync('./outputs').forEach(file => {
285
- console.log(file);
286
- });
287
-
288
277
const replaceTable = {
289
278
"module-legacy": "Native module",
290
279
"module-mixed": "Turbo module with backward compat",
@@ -298,19 +287,16 @@ jobs:
298
287
"kotlin-swift": "Kotlin and Swift"
299
288
}
300
289
301
- const artifacts = `${{ steps.artifacts.outputs.ARTIFACTS }}`;
302
-
303
- // Get every input by empty line
290
+ const parsedArtifacts = fs.readdirSync('./outputs').map(fileName => {
291
+ const [type, language] = fileName.split("-");
304
292
305
- const splittedArtifacts = artifacts.split("\n\n")
306
- const parsedArtifacts = splittedArtifacts.map((artifact) => {
307
- // The first line indicates the type
308
- const type = artifacts.split("\n").shift()
309
- const typeReplaced = Object.entries(replaceTable).reduce((acc, [key, value]) => {
293
+ const header = Object.entries(replaceTable).reduce((acc, [key, value]) => {
310
294
return acc.replace(new RegExp(key, "g"), value);
311
- }, type)
295
+ }, `${type} ${language}`);
296
+
297
+ const fileContents = fs.readFileSync(`./outputs/${fileName}`, 'utf8');
312
298
313
- return `<details><summary>${typeReplaced }</summary>\n\n\`\`\`diff\n${artifact }\n\`\`\`\n</details>\n\n`;
299
+ return `<details><summary>${header }</summary>\n\n\`\`\`diff\n${fileContents }\n\`\`\`\n</details>\n\n`;
314
300
})
315
301
316
302
const body = `🤓☝️ This PR changes the output of \`create-react-native-library\`. You can find the diffs of effected templates below:
0 commit comments