diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 695c63e..1e4a823 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -21,7 +21,7 @@ jobs:
       - name: Extract Version from pubspec.yaml
         id: extract_version
         run: |
-           $VERSION = Select-String  -Path ".\pubspec.yaml" -Pattern "version: (\d+\.\d+\.\d+)" -CaseSensitive | ForEach-Object{ $_.Matches.Groups[1].Value }
+           $VERSION = Select-String  -Path ".\pubspec.yaml" -Pattern "^\s*version:\s*(\d+\.\d+\.\d+)" -CaseSensitive | ForEach-Object{ $_.Matches.Groups[1].Value }
            echo version=$VERSION >> $env:GITHUB_OUTPUT
            
   Build-package:
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 3d6ace3..4f676f9 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -15,7 +15,7 @@ jobs:
       - name: Extract Version from pubspec.yaml
         id: extract_version
         run: |
-           $VERSION = Select-String  -Path ".\pubspec.yaml" -Pattern "version: (\d+\.\d+\.\d+)" -CaseSensitive | ForEach-Object{ $_.Matches.Groups[1].Value }
+           $VERSION = Select-String  -Path ".\pubspec.yaml" -Pattern "^\s*version:\s*(\d+\.\d+\.\d+)" -CaseSensitive | ForEach-Object{ $_.Matches.Groups[1].Value }
            echo version=$VERSION >> $env:GITHUB_OUTPUT
            
   Build-windows: