Skip to content

release: publish npm via OIDC trusted publisher - #169

Merged
yourconscience merged 1 commit into
mainfrom
fm/npm-oidc-trusted-publisher
Sep 10, 2026
Merged

release: publish npm via OIDC trusted publisher#169
yourconscience merged 1 commit into
mainfrom
fm/npm-oidc-trusted-publisher

Conversation

@yourconscience

@yourconscience yourconscience commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • The NPM_TOKEN granular token now triggers npm EOTP on publish (npm 2026 restriction on bypass-2FA tokens).
  • The package now has a Trusted Publisher connection (GitHub Actions, yourconscience/dotagents, release.yml), so remove the token wiring and let npm publish authenticate via OIDC (id-token: write is already granted; provenance unchanged).
  • This restores the pre-v0.8.0 publish shape used for 0.7.0.

Testing

  • Workflow-only change; validated by re-tagging v0.8.0 after merge.

Summary by Sourcery

Switch npm releases to Trusted Publisher OIDC authentication to restore reliable package publishing.

Bug Fixes:

  • Restore npm package publishing by removing the token-based authentication that triggers publish-time EOTP failures.

Enhancements:

  • Use npm Trusted Publisher OIDC authentication for GitHub Actions releases while retaining provenance generation.

CI:

  • Update the release workflow to publish without wiring the NPM_TOKEN secret.

@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the release workflow to publish through npm’s GitHub Actions OIDC trusted publisher instead of the EOTP-incompatible NPM_TOKEN, while preserving provenance and the existing release flow.

Sequence diagram for OIDC-based npm release publishing

sequenceDiagram
    participant GitHubActions
    participant NPM
    participant PackageRegistry
    GitHubActions->>NPM: npm view package version
    alt version already published
        NPM-->>GitHubActions: Existing version
        GitHubActions-->>GitHubActions: Skip publish
    else version not published
        GitHubActions->>NPM: npm publish with NPM_CONFIG_PROVENANCE=true
        NPM->>GitHubActions: Authenticate via OIDC trusted publisher
        NPM->>PackageRegistry: Publish package and provenance
        PackageRegistry-->>GitHubActions: Publish result
    end
Loading

File-Level Changes

Change Details Files
Switch npm release authentication from a static token to the configured GitHub Actions OIDC trusted publisher.
  • Remove the NPM_TOKEN-backed NODE_AUTH_TOKEN environment variable from the publish step.
  • Retain npm provenance generation and the existing version-check/publish workflow behavior.
  • Rely on the workflow’s existing id-token: write permission and the package’s trusted publisher configuration.
.github/workflows/release.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a38fd0e0-4ba9-42c5-80ee-17b1499c1d05


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. This changes npm publishing from a stored token to OIDC-based authorization, so a trust-policy or workflow mistake could block releases or allow an unintended identity to publish the package. Reverting restores the token-based path, but any package publication or exposed authorization that occurred before the revert would not be undone.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@yourconscience
yourconscience merged commit ff58e5d into main Sep 10, 2026
6 checks passed
@yourconscience
yourconscience deleted the fm/npm-oidc-trusted-publisher branch September 10, 2026 10:28
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