Skip to content

ci: serialize npm publish per ref (fix 409 race) - #581

Merged
neuromechanist merged 1 commit into
devfrom
fix/npm-publish-concurrency
May 22, 2026
Merged

neuromechanist merged 1 commit into
devfrom
fix/npm-publish-concurrency

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Problem

npm-publish.yml fires on every push to non-main branches. Multiple commits within a few seconds race in npm's eventual-consistency layer:

npm error 409 Conflict - PUT https://registry.npmjs.org/nemar-cli
Failed to save packument. A common cause is if you try to publish a new
package before the previous package has been fully processed.

Observed on PRs #566 and #553 during the recent release batch (multiple rapid review-fix commits triggered overlapping publishes).

Fix

Workflow-level concurrency block grouped by github.ref with cancel-in-progress: true. At most one publish per branch/tag at any moment; latest push wins.

Why this scope

  • No trigger change (preview-per-PR, dev pre-release, tag release intact)
  • No effect on tag refs (each tag is its own group)
  • Worst case: cancel a publish that would have succeeded — next push re-runs

@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR581

Version: 0.8.27-PR581.fba7354
Commit: fba7354


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 88d903f into dev May 22, 2026
9 checks passed
@neuromechanist
neuromechanist deleted the fix/npm-publish-concurrency branch May 22, 2026 19:31
neuromechanist added a commit that referenced this pull request May 22, 2026
Cross-phase review on dev→main #580 found Commander's '30' default always overrode the server-side ?? 1 default for --missing-metadata, hiding the 24h recency guard from #579. Fix moves default into the action handler per filter. Admin-merge: publish workflow fails with the npm 409 race that #581 (just merged) fixes for next time.

This branch was previously deployed

1 inactive deployment
npm — fba73542 Deployed May 22, 2026 by neuromechanist via publish #1071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant