From 83277a661b3153ce571b0f4f2bc980116e0ef096 Mon Sep 17 00:00:00 2001 From: boronine-bot Date: Sun, 16 Aug 2026 20:20:50 +0000 Subject: [PATCH] Fail release if tag and POM version are out of sync --- .github/workflows/release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34c6199..ce22fbc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,17 @@ jobs: distribution: temurin java-version: '8' + - name: Verify tag matches POM version + if: startsWith(github.ref, 'refs/tags/') + run: | + TAG_VERSION="${GITHUB_REF_NAME#v}" + POM_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" + if [ "$TAG_VERSION" != "$POM_VERSION" ]; then + echo "::error::tag ${GITHUB_REF_NAME} does not match POM version ${POM_VERSION}" + exit 1 + fi + echo "Tag and POM version match: ${POM_VERSION}" + - name: Import GPG key env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}