Skip to content

Commit 7e9a2cc

Browse files
committed
minor fix for action script
1 parent ec92923 commit 7e9a2cc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ jobs:
3030
- name: Publish to npm
3131
run: |
3232
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
33-
yarn publish --non-interactive
33+
yarn publish --non-interactive || {
34+
if grep -q "You cannot publish over the previously published versions" <<< "$(cat /home/runner/.npm/_logs/*-debug-0.log)"; then
35+
echo "Version already exists on npm - treating as success"
36+
exit 0
37+
else
38+
exit 1
39+
fi
40+
}
3441
env:
3542
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)