diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml
index e1ecd4a73..ede98c8e8 100644
--- a/.github/workflows/windows-build.yml
+++ b/.github/workflows/windows-build.yml
@@ -26,7 +26,7 @@ jobs:
     - name: Compile htslib
       shell: msys2 {0}
       run: |
-        export PATH="/mingw64/bin:/c/Program Files/Git/bin:$PATH"
+        export PATH="$PATH:/mingw64/bin:/c/Program Files/Git/bin"
         export MSYSTEM=MINGW64
         autoreconf -i
         ./configure
@@ -34,7 +34,7 @@ jobs:
     - name: Check Htslib
       shell: msys2 {0}
       run: |
-        export PATH="/mingw64/bin:/c/Program Files/Git/bin:$PATH"
+        export PATH="$PATH:/mingw64/bin:/c/Program Files/Git/bin"
         export MSYSTEM=MINGW64
         make test-shlib-exports && make check