Skip to content

ci: auto-publish to npm on every merge to main#90

Open
nadavosa wants to merge 1 commit intomainfrom
fix/auto-publish-on-merge
Open

ci: auto-publish to npm on every merge to main#90
nadavosa wants to merge 1 commit intomainfrom
fix/auto-publish-on-merge

Conversation

@nadavosa
Copy link
Copy Markdown
Collaborator

Problem

The publish workflow was workflow_dispatch only (manual trigger), which meant someone had to remember to go to GitHub Actions and click run after every merge. The programmer was working around this by publishing locally instead.

Changes

  • Auto-trigger on every push to main (plus keep workflow_dispatch as manual fallback)
  • Commit version bump back to repo — previously --no-git-tag-version changed package.json only in the CI runner, so the repo's version was always behind npm. Now the bumped package.json is committed and pushed with [skip ci] to prevent an infinite loop
  • Fix broken script nameyarn publish:npm doesn't exist; changed to yarn publish --non-interactive (matches the publish script in package.json)

Result

After merging any PR into main, the workflow runs automatically, bumps the patch version, commits it, and publishes to npmjs.com. No manual steps needed.

🤖 Generated with Claude Code

- Trigger on push to main (not just manual workflow_dispatch)
- Commit version bump back to repo so package.json stays in sync
- Add [skip ci] guard to prevent infinite loop from the version bump commit
- Fix script name: publish:npm → publish --non-interactive

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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