PDX-000: fix(ci): make npm publish idempotent and wait for registry propagation#166
Merged
Merged
Conversation
…ropagation before MCP publish RCA: MCP registry publish failed with 404 because npm package was not yet indexed when mcp-publisher ran immediately after npm publish. Fix: Skip npm publish if version already exists on npm, and poll npm registry for up to 3 minutes before running mcp-publisher publish. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the manual deploy GitHub Actions workflow to make publishing more robust by avoiding duplicate npm publish attempts and reducing the race where downstream publishing runs before npm’s registry/CDN has indexed the new version.
Changes:
- Skip
npm publishwhen the currentpackage.jsonversion already exists on the npm registry. - Add a polling step (up to ~3 minutes) to wait for the new version to become available on npm before running
mcp-publisher publish.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+37
to
+42
| VERSION=$(node -p "require('./package.json').version") | ||
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://registry.npmjs.org/%40provartesting%2Fprovardx-cli/${VERSION}") | ||
| if [ "$STATUS" = "200" ]; then | ||
| echo "Version ${VERSION} already published on npm, skipping." | ||
| else | ||
| npm publish --tag "$TAG" --access public |
| echo "Attempt ${i}/18: npm returned ${STATUS}, retrying in 10s..." | ||
| sleep 10 | ||
| done | ||
| echo "Package not available after 3 minutes; proceeding anyway." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcp-publisher publishto avoid the 404 race conditionRoot cause
mcp-publisher publishvalidates the npm package exists before publishing to the MCP registry. The step ran immediately afternpm publish, but npm's CDN hadn't indexed the new version yet, causing a 404.Test plan
🤖 Generated with Claude Code