diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index 99fe77f7ee..d13257f0ba 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -86,7 +86,15 @@ jobs: shell: bash working-directory: ./node run: | - npm publish --access public + npm_publish_err=`npm publish --access public 2>&1` + echo $npm_publish_err + if [[ ! -z "$npm_publish_err" && "$npm_publish_err" == *"You cannot publish over the previously published versions"* ]] + then + echo "Skipping publishing, package already published" + else + echo "Failed to publish with error: ${npm_publish_err}" + ls bar + fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}