diff --git a/.github/workflows/scoped-test.yaml b/.github/workflows/scoped-test.yaml
index f417839f107b..d0139df299f8 100644
--- a/.github/workflows/scoped-test.yaml
+++ b/.github/workflows/scoped-test.yaml
@@ -30,12 +30,13 @@ jobs:
               - '**/*_test.go'
 
   scoped-tests:
+    needs: changedfiles
+    if: needs.changedfiles.outputs.go_sources != '' || needs.changedfiles.outputs.go_tests != ''
     strategy:
       fail-fast: false
       matrix:
         os: [ windows-latest ]
     runs-on: ${{ matrix.os }}
-    needs: changedfiles
     steps:
       - name: Echo changed files
         shell: bash
@@ -59,9 +60,14 @@ jobs:
             ./.tools
           key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
 
-      - name: Build test tools
+      - name: Build gotestsum on Windows
+        if: runner.os == 'Windows'
         run: make "$(${PWD} -replace '\\', '/')/.tools/gotestsum"
 
+      - name: Build gotestsum
+        if: runner.os != 'Windows'
+        run: make "$PWD/.tools/gotestsum"
+
       - name: Run changed tests
         if: needs.changedfiles.outputs.go_tests
         env:
diff --git a/Makefile.Common b/Makefile.Common
index 021a39c847b7..ff753533d19f 100644
--- a/Makefile.Common
+++ b/Makefile.Common
@@ -279,7 +279,7 @@ for-affected-components:
 		if [ -z '$${DEPENDENT_PKGS}' ]; then \
 			echo "No other package depends on the one being changed."; \
 		else \
-			DEPENDENT_PKG_DIRS=$$(echo $${DEPENDENT_PKGS} | tr ' ' '\n' | xargs -I {} grep --include=go.mod -rl {} | xargs dirname | uniq); \
+			DEPENDENT_PKG_DIRS=$$(echo $${DEPENDENT_PKGS} | tr ' ' '\n' | xargs -I {} grep --include=go.mod -rl {} | xargs -r dirname | uniq); \
 			set -e; for dir in $$(echo $${DEPENDENT_PKG_DIRS}); do \
 			(cd "$${dir}" && \
 				echo "running $${CMD} in $${dir}" && \