diff --git a/.github/workflows/check-commits.yml b/.github/workflows/check-commits.yml index 6f7cd97..1057d53 100644 --- a/.github/workflows/check-commits.yml +++ b/.github/workflows/check-commits.yml @@ -16,7 +16,10 @@ jobs: - uses: FlowingCode/action-conventional-commits@master - name: Get version - run: echo "VERSION=$(grep -oPm1 "(?<=)[^<]+" "pom.xml")" >> $GITHUB_ENV && cat $GITHUB_ENV | grep VERSION= + run: | + V=$(grep "" pom.xml | sed -E 's/.*(.*)<\/version>.*/\1/' | sed -n '2p') + [ -z "$V" ] && V=$(grep "" pom.xml | sed -E 's/.*(.*)<\/version>.*/\1/' | sed -n '1p') + echo "VERSION=$(echo $V | xargs)" >> $GITHUB_ENV - name: Check snapshot version if: ${{ !endsWith( env.VERSION , '-SNAPSHOT' ) }}