@@ -238,12 +238,14 @@ jobs:
238238 git config --global user.name "github-actions[bot]"
239239
240240 echo "Extracting current branch tests..."
241- find tests/suites -type f -name "*.test.ts" -exec sh -c '
242- file="$1"
243- grep -E "test\(['\\\"]" "$file" | sed -E "s/.*test\(['\\\"]([^'\\\"]+)['\\\"].*/\1/" | while read -r test_name; do
244- echo "$test_name|$file"
245- done
246- ' sh {} \; > "$current_tests_file"
241+ while IFS= read -r file; do
242+ while IFS= read -r line; do
243+ if [[ $line =~ test\([\"\'](.*)[\"\']\) ]]; then
244+ test_name="${BASH_REMATCH[1]}"
245+ echo "$test_name|$file"
246+ fi
247+ done < "$file"
248+ done < <(find tests/suites -type f -name "*.test.ts") > "$current_tests_file"
247249
248250 echo "Fetching main branch..."
249251 git fetch origin main:main
@@ -255,14 +257,16 @@ jobs:
255257 git checkout main
256258
257259 echo "Extracting main branch tests..."
258- find tests/suites -type f -name "*.test.ts" -exec sh -c '
259- file="$1"
260+ while IFS= read -r file; do
260261 if [ -f "$file" ]; then
261- grep -E "test\(['\\\"]" "$file" | sed -E "s/.*test\(['\\\"]([^'\\\"]+)['\\\"].*/\1/" | while read -r test_name; do
262- echo "$test_name|$file"
263- done
262+ while IFS= read -r line; do
263+ if [[ $line =~ test\([\"\'](.*)[\"\']\) ]]; then
264+ test_name="${BASH_REMATCH[1]}"
265+ echo "$test_name|$file"
266+ fi
267+ done < "$file"
264268 fi
265- ' sh {} \; > "$base_tests_file"
269+ done < <(find tests/suites -type f -name "*.test.ts") > "$base_tests_file"
266270
267271 echo "Returning to original branch..."
268272 git checkout "$current_branch"
0 commit comments