Skip to content

chore(NODE-7568): migrate release workflow to npm Trusted Publishing#124

Open
tadjik1 wants to merge 3 commits into
mainfrom
chore/NODE-7568-npm-trusted-publishers
Open

chore(NODE-7568): migrate release workflow to npm Trusted Publishing#124
tadjik1 wants to merge 3 commits into
mainfrom
chore/NODE-7568-npm-trusted-publishers

Conversation

@tadjik1
Copy link
Copy Markdown
Contributor

@tadjik1 tadjik1 commented May 18, 2026

Description

Summary of Changes

Migrate mongodb-connection-string-url off NPM_TOKEN and onto npm Trusted Publishing (OIDC) per NODE-7568.

Since this repo has a single release workflow, release.yml is registered directly as the trusted publisher on npmjs.com — no separate npm-publish.yml indirection needed.

The only change needed is removing NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} from the publish step — id-token: write was already present at the workflow level, so npm publish --provenance can obtain the OIDC token automatically.

Notes for Reviewers

Before merging: An npm Trusted Publishing entry must be configured on npmjs.com for the mongodb-connection-string-url package, pointing at .github/workflows/release.yml in this repo. Once verified, NPM_TOKEN can be removed from the repo secrets and the package switched to "Require two-factor authentication and disallow tokens."

Double check the following

  • Lint is passing
  • Self-review completed
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

tadjik1 added 2 commits May 18, 2026 16:22
Switch the publish step from NPM_TOKEN to OIDC. Since this repo has a
single release workflow, release.yml is registered directly as the trusted
publisher on npmjs.com — no separate npm-publish.yml needed.

- Move id-token: write to job level (least-privilege); release-please job
  retains contents: write and pull-requests: write it already needed.
- Remove NODE_AUTH_TOKEN / NPM_TOKEN; npm publish --provenance uses OIDC.
@tadjik1 tadjik1 marked this pull request as ready for review May 18, 2026 14:27
@tadjik1 tadjik1 requested a review from a team as a code owner May 18, 2026 14:27
Copilot AI review requested due to automatic review settings May 18, 2026 14:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the release workflow to publish to npm using Trusted Publishing/OIDC instead of an NPM_TOKEN.

Changes:

  • Removes NODE_AUTH_TOKEN from the npm publish --provenance --tag latest step.
  • Keeps release publishing gated on release-please creating a release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
@PavelSafronov PavelSafronov self-assigned this May 21, 2026
Copy link
Copy Markdown
Contributor

@PavelSafronov PavelSafronov left a comment

Choose a reason for hiding this comment

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

Changes look good. Let's confirm the npm package info has been updated, then we can merge this.

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.

3 participants