Skip to content

Commit

Permalink
NPM CD: Fixed not failing on already published package
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Feb 11, 2024
1 parent 4861aa4 commit 147f21c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ jobs:
shell: bash
working-directory: ./node
run: |
npm publish --access public
npm_publish_err=`npm publish --access public 2>&1`
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}"
exit 1
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

Expand Down

0 comments on commit 147f21c

Please sign in to comment.