diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 8421bcffd8..c960a484ed 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -26,10 +26,10 @@ jobs: git branch --remote --contains | grep origin/main - name: Set VERSION variable run: | - if [[ "${{ github.ref }}" == refs/tags/* ]]; then - TAG_NAME=${{ github.ref }} # e.g., refs/tags/preview-740-hotfix-1 + if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == 'published']]; then + TAG_NAME=${{ github.ref }} # e.g., refs/tags/3.0.0 TAG_NAME=${TAG_NAME#refs/tags/} # remove the refs/tags/ prefix - echo "VERSION=3.0.0-preview-${TAG_NAME}.${{github.run_number}}" >> $GITHUB_ENV + echo "VERSION=${TAG_NAME}" >> $GITHUB_ENV else echo "VERSION=3.0.0-preview.${{github.run_number}}" >> $GITHUB_ENV fi