From f83902f326a9f555d457a82d6778e2bbe30a0f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Luis=20Gonza=CC=81lez=20Paz?= Date: Tue, 21 Apr 2026 08:20:14 -0300 Subject: [PATCH 1/2] fix: set VERSION as maven project version instead first version found Close #1 --- .github/workflows/check-commits.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-commits.yml b/.github/workflows/check-commits.yml index 6f7cd97..708c2cf 100644 --- a/.github/workflows/check-commits.yml +++ b/.github/workflows/check-commits.yml @@ -16,7 +16,7 @@ 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: echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV - name: Check snapshot version if: ${{ !endsWith( env.VERSION , '-SNAPSHOT' ) }} From 6fcfbb7c7667417db70b398df7853cb1ae6a8487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicola=CC=81s=20Luis=20Gonza=CC=81lez=20Paz?= Date: Tue, 21 Apr 2026 09:35:47 -0300 Subject: [PATCH 2/2] fix: make get version depend only on projects version Get version identifies the project's specific version by targeting the second occurrence in the document hierarchy. Contains conditional fallback if pom does not have parent. Close #2 --- .github/workflows/check-commits.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-commits.yml b/.github/workflows/check-commits.yml index 708c2cf..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=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV + 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' ) }}