diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dfb2d1..ce72cbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,12 +47,12 @@ jobs: shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch + - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - run: npm run publish:release -- --canary --preid=$BRANCH.$GITHUB_RUN_ID.$GITHUB_RUN_NUMBER --dist-tag=$BRANCH --yes - if: ${{ github.event_name == 'push' && github.repository == 'ringcentral/ringcentral-js' }} + if: ${{ contains(env.TAG, 'refs/heads') && github.event_name == 'push' && github.repository == 'ringcentral/ringcentral-js' }} env: BRANCH: ${{ steps.extract_branch.outputs.branch }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - run: npm run publish:release -- $TAG --yes if: ${{ env.TAG != '' && !contains(env.TAG, '/') && !contains(env.TAG, '-') && github.repository == 'ringcentral/ringcentral-js' }} env: