diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 75d63c5..ff3b96d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -217,17 +217,17 @@ jobs: path: target/ - name: Get Tagged Version id: lasttag - if: ${{ endsWith(github.base_ref, 'main') && (contains(github.head_ref, 'release/') || github.event.pull_request.merged) }} run: | git config --global --add safe.directory "$PWD" - apt-get update && apt-get install -yqq jq COMMIT="${{github.sha}}" if ${{contains(github.head_ref, 'release')}}; then V="${{github.head_ref}}" V="${V#release/}" else V="$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version')" - V=v${V//\"/} #remove '"'s + echo "Extracted version: $V" + V="$(echo "v${V}" | sed 's/\"//g')" + echo "Cleaned up version: $V" fi # Check to see if the version tag already exists @@ -242,6 +242,7 @@ jobs: # 2) This is a feature branch being merged into the main branch. if ${{(! github.event.pull_request.merged && contains(github.head_ref, 'release/')) || (github.event.pull_request.merged && !contains(github.head_ref, 'release/'))}}; then V="${V}-$(git tag --list ${V}* | wc -l)" + echo "RC Version: $V" fi CL=${V#v} @@ -330,15 +331,17 @@ jobs: - name: Get Tagged Version id: lasttag run: | + git config --global --add safe.directory "$PWD" - apt-get install -yqq jq COMMIT="${{github.sha}}" - if ${{contains(github.head_ref, 'release/')}}; then + if ${{contains(github.head_ref, 'release')}}; then V="${{github.head_ref}}" V="${V#release/}" else V="$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version')" - V=v${V//\"/} #remove '"'s + echo "Extracted version: $V" + V="$(echo "v${V}" | sed 's/\"//g')" + echo "Cleaned up version: $V" fi # Check to see if the version tag already exists @@ -353,6 +356,7 @@ jobs: # 2) This is a feature branch being merged into the main branch. if ${{(! github.event.pull_request.merged && contains(github.head_ref, 'release/')) || (github.event.pull_request.merged && !contains(github.head_ref, 'release/'))}}; then V="${V}-$(git tag --list ${V}* | wc -l)" + echo "RC Version: $V" fi CL=${V#v}