diff --git a/.github/workflows/build-test-publish-superscript-npm.yml b/.github/workflows/build-test-publish-superscript-npm.yml index 939d90d..bb1d5ad 100644 --- a/.github/workflows/build-test-publish-superscript-npm.yml +++ b/.github/workflows/build-test-publish-superscript-npm.yml @@ -157,7 +157,14 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: | cd wasm - npm publish --access public + # Try a normal publish first; if it fails (e.g. first-time publish of a + # scoped package), retry with --access public. + if npm publish; then + echo "Published successfully with 'npm publish'" + else + echo "'npm publish' failed, retrying with --access public..." + npm publish --access public + fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file