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 62a3d3e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ jobs:
shell: bash
working-directory: ./node
run: |
npm publish --access public
set +e
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 62a3d3e

Please sign in to comment.