From 4837d578028bb097cf7fe8e31ac0280b52a73d26 Mon Sep 17 00:00:00 2001 From: Yevhen Vasyliev Date: Tue, 14 Nov 2023 20:31:47 +0200 Subject: [PATCH] Validate current version --- .github/workflows/release-v2.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-v2.yml b/.github/workflows/release-v2.yml index 50adeb9..160051d 100644 --- a/.github/workflows/release-v2.yml +++ b/.github/workflows/release-v2.yml @@ -67,4 +67,15 @@ jobs: CURRENT_VERSION: ${{ steps.get-current-version.outputs.current-version }} run: | echo "current-version=$CURRENT_VERSION" - echo "Current version is \`$CURRENT_VERSION\`" >> $GITHUB_STEP_SUMMARY \ No newline at end of file + echo "Current version is \`$CURRENT_VERSION\`" >> $GITHUB_STEP_SUMMARY + - name: Validate current version + if: github.event.inputs.release_type != 'provided' + env: +# CURRENT_VERSION: ${{ steps.get-current-version.outputs.current-version }} + CURRENT_VERSION: 1.2.3a + run: | + if [[ ! $CURRENT_VERSION =~ ^([[:digit:]]+\.){2}[[:digit:]]+([\.-].+)?$ ]] + then + echo "::error::Unexpected artifact version found in pom.xml: $CURRENT_VERSION. Expected format: x.y.z*" + exit 1 + fi \ No newline at end of file