diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93537fe..64fabe4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: - name: Test parsing 'go.mod' run: | - bin/parse-legacy-file test-fixtures/go.mod | grep "^1.19.3" + bin/parse-legacy-file test-fixtures/go.mod | grep "^1.18.6" - name: Test parsing '.go-version' run: | bin/parse-legacy-file test-fixtures/.go-version | grep "^1.17.13" diff --git a/bin/parse-legacy-file b/bin/parse-legacy-file index c6f0e13..4c1af63 100755 --- a/bin/parse-legacy-file +++ b/bin/parse-legacy-file @@ -34,7 +34,7 @@ get_legacy_version() { sed -E \ -e 's/.*heroku goVersion //' \ -e 's/[[:space:]]//' \ - -e 's/go([0-9]+).*/\1/' | + -e 's/go([1-9][[:digit:]]*\.[[:digit:]]+(\.[[:digit:]]+)?)/\1/' | head -1 ) elif [ -e "$current_file" ]; then