diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 1f18fa41c9..1089ad4ee8 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -39,6 +39,13 @@ jobs: run: node scripts/prepublish.mjs - name: Publish to npm - run: npm publish --access public + run: | + VERSION=$(node -p "require('./package.json').version") + # Check if this version is already published — skip instead of failing with E403 + if npm view "omniroute@${VERSION}" version --silent 2>/dev/null | grep -q "^${VERSION}$"; then + echo "️⚠️ Version ${VERSION} is already published on npm — skipping." + exit 0 + fi + npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}