Skip to content

Migrate to npm trusted publishing - #12

Merged
csark0812 merged 1 commit into
mainfrom
cursor/migrate-to-npm-trusted-publishing-composer-1-840c
Nov 26, 2025
Merged

Migrate to npm trusted publishing#12
csark0812 merged 1 commit into
mainfrom
cursor/migrate-to-npm-trusted-publishing-composer-1-840c

Conversation

@csark0812

@csark0812 csark0812 commented Nov 26, 2025

Copy link
Copy Markdown
Owner

Migrate npm publishing to Trusted Publishing by consolidating two workflows into one and using OIDC for authentication.


Open in Cursor Open in Web


Note

Consolidates release workflows into a single OIDC-based Trusted Publishing pipeline that supports PR-merge and manual releases, with automated versioning and GitHub Release creation.

  • CI/Workflows:
    • Unified publishing workflow: Add /.github/workflows/publish.yml combining PR-merge and manual (workflow_dispatch) release paths.
      • Supports manual inputs: version or bump_type; otherwise infers bump from PR labels (major/minor/patch).
      • Grants id-token: write and publishes to npm using OIDC (Trusted Publishing); installs npm@latest.
      • Runs build and tests, bumps package.json, commits, tags, pushes, publishes to npm, and creates a GitHub Release.
    • Remove legacy workflows: Delete /.github/workflows/publish-on-merge.yml and /.github/workflows/release.yml.

Written by Cursor Bugbot for commit 8afcc73. This will update automatically on new commits. Configure here.

Combine publish-on-merge and release workflows into a single publish workflow. This simplifies CI/CD by providing a unified approach to versioning and publishing. The new workflow supports both automatic publishing on PR merge and manual dispatch for specific versioning needs.

Co-authored-by: csark0812 <csark0812@gmail.com>
@cursor

cursor Bot commented Nov 26, 2025

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@csark0812
csark0812 marked this pull request as ready for review November 26, 2025 23:36
@csark0812
csark0812 merged commit 37cd73a into main Nov 26, 2025
1 check passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

if [ -n "${{ inputs.version }}" ]; then
NEW_VERSION="${{ inputs.version }}"
echo "Using provided version: $NEW_VERSION"
npm version $NEW_VERSION --no-git-tag-version --allow-same-version

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Version mismatch when manually providing version

When manually triggering the workflow with a provided version, NEW_VERSION is set from the input before running npm version, but never updated afterward. If npm normalizes the version string (e.g., "2.2" becomes "2.2.0"), the variable will contain the unnormalized value, causing mismatches in git tags, commit messages, and GitHub releases compared to the actual package.json version.

Fix in Cursor Fix in Web

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.

2 participants