ci(npm-publish): trigger on release published, not v* tags#104
Merged
Conversation
The tag convention switched to plain '0.9.x' but the workflow still filtered 'v*', so plain-tagged releases never auto-published. Trigger on the GitHub release 'published' event instead, which is independent of tag naming. The release commit's package.json remains the version source; workflow_dispatch stays as a manual fallback.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the npm publish workflow trigger so releases publish to npm automatically even when the repo’s tag naming convention is plain 0.9.x instead of v0.9.x.
Changes:
- Switch
npm-publish.ymlfrompush.tags: ['v*']toon: releasewithtypes: [published]. - Keep
workflow_dispatchas a manual fallback (workflow body otherwise unchanged).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
7
to
+9
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| release: | ||
| types: [published] |
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.



Problem
npm-publish.ymlonly triggered onpush: tags: ['v*'], but the release tag convention switched to plain0.9.x(e.g.0.9.30,0.9.32,0.9.36). Plain tags don't matchv*, so recent releases never auto-published to npm — each needed a manualworkflow_dispatch.Fix
Trigger on the GitHub release
publishedevent instead of a tag-name filter. This is independent of whether the tag isv0.9.xor0.9.x, so it can't drift from the tag convention again. The tag-push trigger is dropped (avoids double-firing, since creating a release also creates a tag);workflow_dispatchstays as a manual fallback.The job body is unchanged and already compatible:
package.json(no tag/ref parsing).Set version/dry_runsteps are gated oninputs.*, which are empty on a release event, so a published release runs a normal publish with the package.json version.Note
This only affects future releases.
0.9.36is already published (its release event predates this change), so it still needs a one-time manualworkflow_dispatchto reach npm.