From f70cbd32e79c27368445807b689e134164ebd257 Mon Sep 17 00:00:00 2001
From: michael-hawker <24302614+michael-hawker@users.noreply.github.com>
Date: Mon, 14 Aug 2023 13:24:57 -0700
Subject: [PATCH] Fixes issues with the build script in detecting dump files to
 upload and analyze

dorny/paths-filter only works on detecting changes to git files not untracked files
---
 .github/workflows/build.yml | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b38aea89..f9c71043 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -182,26 +182,22 @@ jobs:
 
       # https://github.com/dorny/paths-filter#custom-processing-of-changed-files
       - name: Detect If any Dump Files
-        uses: dorny/paths-filter@v2.11.1
-        id: filter
-        with:
-          list-files: shell
-          filters: |
-            dump:
-              - added: '${{ github.workspace }}/CrashDumps/*.dmp'
+        id: detect-dump
+        run: |
+          echo "DUMP_FILE=$(ls -1 ${{ github.workspace }}/CrashDumps/*.dmp)" >> "$GITHUB_OUTPUT"
 
       - name: Artifact - WER crash dumps
         uses: actions/upload-artifact@v3
-        if: ${{ steps.filter.outputs.dump == 'true' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
+        if: ${{ steps.detect-dump.outputs.DUMP_FILE != '' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
         with:
           name: CrashDumps-${{ matrix.platform }}
           path: '${{ github.workspace }}/CrashDumps'
 
       - name: Analyze Dump
-        if: ${{ steps.filter.outputs.dump == 'true' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
+        if: ${{ steps.detect-dump.outputs.DUMP_FILE != '' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
         run: |
           dotnet tool install --global dotnet-dump
-          dotnet-dump analyze ${{ steps.filter.outputs.dump_files }} -c "clrstack" -c "pe -lines" -c "exit"
+          dotnet-dump analyze ${{ steps.detect-dump.outputs.DUMP_FILE }} -c "clrstack" -c "pe -lines" -c "exit"
 
   wasm-linux:
     runs-on: ubuntu-latest