diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ef94c03622252..52b98fa734131 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -49,14 +49,15 @@ jobs:
           echo "/opt/local/bin" >> $GITHUB_PATH
           echo "/opt/local/sbin" >> $GITHUB_PATH
 
-          IFS='/' read -r -a portlist <<<$( \
+          portlist=$( \
             git -C ports/ diff --name-only --diff-filter=AM macports/master...@ \
               | sed -En 's,^[^._/][^/]*/([^/]+)/(Portfile$|files/),\1,p' \
               | sort -u \
-              | tr '\n' '/')
+              | tr '\n' ' ' \
+              | sed 's/ $//')
 
-          echo "${portlist[@]}"
-          echo "portlist=${portlist[@]}" >> $GITHUB_OUTPUT
+          echo "$portlist"
+          echo "portlist=$portlist" >> $GITHUB_OUTPUT
 
       - name: Determine list of subports from portlist
         id: subportlist