diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 26225538..df99051b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,10 +44,11 @@ jobs: - name: Validate tag version if: ${{ startsWith(github.ref, 'refs/tags') }} run: | + TAG_VALUE=${GITHUB_REF/refs\/tags\//} PYTHON_VERSION=$(grep -E '\bversion\s?=\s?"[^"]+"' pyproject.toml | awk -F '"' '{print $2}') echo "Tag version is [${{ steps.version.outputs.version }}], Python version is [$PYTHON_VERSION]" - if [ "${{ steps.version.outputs.version }}" != "$PYTHON_VERSION" ]; then - echo "Version mismatch; tag version is [${{ steps.version.outputs.version }}] but Python version is [$PYTHON_VERSION]" >> $GITHUB_STEP_SUMMARY + if [ "$TAG_VALUE" != "$PYTHON_VERSION" ]; then + echo "Version mismatch; tag version is [$TAG_VALUE] but Python version is [$PYTHON_VERSION]" >> $GITHUB_STEP_SUMMARY exit 1 fi