diff --git a/.github/workflows/node-sdk.yml b/.github/workflows/node-sdk.yml index 9d934284..55ea4ee2 100644 --- a/.github/workflows/node-sdk.yml +++ b/.github/workflows/node-sdk.yml @@ -46,6 +46,7 @@ jobs: run: echo ::set-output name=TAG::$(git describe --tags --abbrev=0) - name: Update zrok NodeJS-SDK's package.json version based on current zrok repo git tag + if: github.ref == 'refs/heads/main' run: | cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk npm version ${{ steps.tag.outputs.TAG }} --no-git-tag-version --allow-same-version @@ -54,6 +55,7 @@ jobs: git commit -am "Update package.json version to ${{ steps.tag.outputs.TAG }}" || echo "No changes to commit" - name: Push changes to zrok NodeJS-SDK's package.json + if: github.ref == 'refs/heads/main' uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -88,9 +90,8 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: NPM Publish + if: github.ref == 'refs/heads/main' uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} access: public - if: | - startsWith(github.ref, 'refs/tags/')