Skip to content

ci: publish v14.6.2 to npm via OIDC - #1317

Merged
kentcdodds merged 1 commit into
mainfrom
cursor/fix-npm-oidc-publish-29d6
Aug 3, 2026
Merged

ci: publish v14.6.2 to npm via OIDC#1317
kentcdodds merged 1 commit into
mainfrom
cursor/fix-npm-oidc-publish-29d6

Conversation

@kentcdodds

Copy link
Copy Markdown
Member

What

Fix npm publishing. GitHub already has v14.6.2 (includes #1265), but npm is still on 14.6.1 because the old Docker release action only enables @semantic-release/npm when NPM_TOKEN is set — and this repo has no NPM_TOKEN.

Why

Same situation as dom-testing-library: publish with npm trusted publishing (OIDC), not a long-lived token.

How

  • Release job uses cycjimmy/semantic-release-action on the runner with id-token: write
  • Uses the production environment (already created on the repo)
  • Backfills npm if a git tag exists but that version is missing from the registry (covers the stuck 14.6.2)

⚠️ One manual step before/when merging

Configure the trusted publisher on npm (you’re a maintainer):

  1. Open https://www.npmjs.com/package/@testing-library/user-event/access
  2. Under Trusted Publisher, add GitHub Actions with:
    • Organization or user: testing-library
    • Repository: user-event
    • Workflow filename: ci.yml
    • Environment: production
  3. Merge this PR (or re-run the release job after merge)

That merge should publish @testing-library/user-event@14.6.2 to npm.

Checklist

  • Ready to be merged
  • Trusted publisher configured on npm (required for publish to succeed)
Open in Web Open in Cursor 

GitHub released v14.6.2 but npm was skipped because ph-fritsche/action-release
only enables the npm plugin when NPM_TOKEN is set, and this repo has none.

Switch the release job to semantic-release on the runner with id-token write
(same approach as dom-testing-library) and backfill any git tag missing from npm.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

@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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 33f7992. Configure here.

Comment thread .github/workflows/ci.yml
echo "Publishing missing ${VERSION} to npm"
npm install -g npm@latest
npm version "${VERSION}" --no-git-tag-version
npm publish --access public

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Backfill publishes wrong artifact

High Severity

The new npm backfill runs after a build at HEAD, then sets package.json to the latest reachable tag and runs npm publish without rebuilding at that tag. If main is ahead of that tag (e.g. CI fixes after v14.6.2), npm can get a tarball for an older version that includes unreleased source.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 33f7992. Configure here.

@kentcdodds
kentcdodds merged commit e8da819 into main Aug 3, 2026
5 of 6 checks passed
@kentcdodds
kentcdodds deleted the cursor/fix-npm-oidc-publish-29d6 branch August 3, 2026 15:31
@csantos-nydig

Copy link
Copy Markdown

@kentcdodds thanks for your help trying to publish the long-awaited fix for #1265 - but unfortunately it seems v14.6.2 is still not available in npm: https://www.npmjs.com/package/@testing-library/user-event?activeTab=versions

kentcdodds added a commit that referenced this pull request Aug 3, 2026
There was an issue with a patch release, so this manual-releases.md change is to release a new patch version.

Reference: #1317
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 14.6.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants