Skip to content

Publish via npm Trusted Publishing (OIDC) for provenance - #40

Merged
kin0992 merged 4 commits into
mainfrom
provenance-trusted-publishing
Jun 1, 2026
Merged

Publish via npm Trusted Publishing (OIDC) for provenance#40
kin0992 merged 4 commits into
mainfrom
provenance-trusted-publishing

Conversation

@kin0992

@kin0992 kin0992 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Problem

Published packages (e.g. @kin0992/oxc-config@0.3.0) have no provenance — the registry's attestation endpoint returns Not found and the #37 release log never printed a "Signed provenance statement".

Root cause, from the release log:

  • The Configure npm scope auth step wrote the npm token into .npmrc, so changeset publish authenticated by token.
  • changeset publish did not produce provenance under that path, despite NPM_CONFIG_PROVENANCE: true and publishConfig.provenance: true.
  • changesets/action even reported OIDC is available - using npm trusted publishing, but the on-disk token overrode it.

Change

Switch to pure npm Trusted Publishing (OIDC):

  • Remove the Configure npm scope auth step (no token on disk).
  • Remove NODE_AUTH_TOKEN from the publish env.
  • Keep id-token: write and NPM_CONFIG_PROVENANCE.

npm then exchanges the workflow's id-token for a short-lived credential and signs provenance automatically.

Required manual step before merging / next release

A Trusted Publisher must be configured on npmjs.org for each package, or the next publish will fail auth:

npmjs.org → each of @kin0992/{oxc-config,skills,tsconfig,vitest-config} → Settings → Trusted Publisher → GitHub Actions → owner kin0992, repo dev-toolkit, workflow release.yml.

Provenance attaches on the next version bump; existing 0.3.0 can't be back-filled.

npm_token secret / registry-url input are left declared (marked deprecated) for backward compatibility with any other callers.

🤖 Generated with Claude Code

The previous release wrote an npm token into .npmrc, so changeset publish
authenticated by token and emitted no provenance despite NPM_CONFIG_PROVENANCE.
Drop the token auth step and NODE_AUTH_TOKEN so publishing uses pure OIDC
trusted publishing, which signs provenance automatically.

Requires a Trusted Publisher to be configured on npmjs.org for each package
(GitHub Actions / kin0992/dev-toolkit / release.yml).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5f7a088

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

kin0992 and others added 3 commits June 1, 2026 23:47
@kin0992 packages are public on npmjs and consumed as workspace:* deps, so
pnpm install needs no registry auth. setup-node only consumes NODE_AUTH_TOKEN
when given a registry-url (it isn't), so the env had no effect.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Publishing uses npm Trusted Publishing (OIDC); no registry token is consumed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the now-unused npm-scope/registry-url inputs from the reusable release
workflow and the npm-scope passed by release.yml. Remove the Pulumi-managed
NPM_TOKEN Actions secret (and its config value) since publishing no longer
uses a registry token. Rewrite the CONSUMING.md release section for npm
Trusted Publishing (OIDC), including the per-package trusted-publisher setup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🍹 preview on dev-toolkit-infra/prod

Pulumi report

View in Pulumi Cloud

  Previewing update (prod)

View Live: https://app.pulumi.com/kin0992/dev-toolkit-infra/prod/previews/6c5d1b21-64e2-469e-8107-2020e1304041

pulumi:pulumi:Stack: (same)
  [urn=urn:pulumi:prod::dev-toolkit-infra::pulumi:pulumi:Stack::dev-toolkit-infra-prod]
  - github:index/actionsSecret:ActionsSecret: (delete)
      [id=dev-toolkit:NPM_TOKEN]
      [urn=urn:pulumi:prod::dev-toolkit-infra::github:index/actionsSecret:ActionsSecret::npm-token]
      [provider=urn:pulumi:prod::dev-toolkit-infra::pulumi:providers:github::default_6_14_0::b8bd2d4c-683e-4fa4-bf68-03f6724778ff]
      repository: "dev-toolkit"
      secretName: "NPM_TOKEN"
      value     : [secret]
  --outputs:--
~ branchProtection: {
      allowsDeletions              : false
      allowsForcePushes            : false
      enforceAdmins                : false
      id                           : "BPR_kwDOSO32N84Eix0X"
      lockBranch                   : false
      pattern                      : "main"
      repositoryId                 : "R_kgDOSO32Nw"
      requireConversationResolution: true
      requireSignedCommits         : false
      requiredLinearHistory        : true
      requiredPullRequestReviews   : [
          [0]: {
              dismissStaleReviews         : true
              dismissalRestrictions       : 
              pullRequestBypassers        : 
              requireCodeOwnerReviews     : false
              requireLastPushApproval     : false
              requiredApprovingReviewCount: 0
              restrictDismissals          : false
          }
      ]
      requiredStatusChecks         : [
          [0]: {
              contexts: [
                  [0]: "Static Analysis (self)"
              ]
              strict  : true
          }
      ]
      urn                          : "urn:pulumi:prod::dev-toolkit-infra::github:index/branchProtection:BranchProtection::main-protection"
  }
~ repo            : {
      allowAutoMerge                     : true
      allowForking                       : true
      allowMergeCommit                   : false
      allowRebaseMerge                   : false
      allowSquashMerge                   : true
      allowUpdateBranch                  : true
      archiveOnDestroy                   : true
      archived                           : false
      defaultBranch                      : "main"
      deleteBranchOnMerge                : true
      description                        : "Platform Engineering toolkit: reusable GitHub Actions, AI Skills, and shared TypeScript configs."
      etag                               : "W/\"5df06006d8a40dbcc2919dc31f9e98b8e46e0707f9c32441b6845789c67089ac\""
      fork                               : "false"
      fullName                           : "kin0992/dev-toolkit"
      gitCloneUrl                        : "git://github.com/kin0992/dev-toolkit.git"
      hasDiscussions                     : false
      hasDownloads                       : false
      hasIssues                          : false
      hasProjects                        : false
      hasWiki                            : false
      htmlUrl                            : "https://github.com/kin0992/dev-toolkit"
      httpCloneUrl                       : "https://github.com/kin0992/dev-toolkit.git"
      id                                 : "dev-toolkit"
      ignoreVulnerabilityAlertsDuringRead: false
      isTemplate                         : false
      mergeCommitMessage                 : "PR_TITLE"
      mergeCommitTitle                   : "MERGE_MESSAGE"
      name                               : "dev-toolkit"
      nodeId                             : "R_kgDOSO32Nw"
      primaryLanguage                    : "JavaScript"
      private                            : false
      repoId                             : 1223554615
      securityAndAnalysis                : {
          advancedSecurity                 : 
          codeSecurity                     : 
          secretScanning                   : {
              status: "enabled"
          }
          secretScanningAiDetection        : 
          secretScanningNonProviderPatterns: 
          secretScanningPushProtection     : {
              status: "enabled"
          }
      }
      squashMergeCommitMessage           : "PR_BODY"
      squashMergeCommitTitle             : "PR_TITLE"
      sshCloneUrl                        : "git@github.com:kin0992/dev-toolkit.git"
      svnUrl                             : "https://github.com/kin0992/dev-toolkit"
      topics                             : [
          [0]: "agent-skills"
          [1]: "changesets"
          [2]: "claude-code"
          [3]: "copilot-cli"
          [4]: "github-actions"
          [5]: "marketplace"
          [6]: "platform-engineering"
          [7]: "pnpm"
          [8]: "pulumi"
          [9]: "turborepo"
          [10]: "typescript"
      ]
      urn                                : "urn:pulumi:prod::dev-toolkit-infra::github:index/repository:Repository::dev-toolkit"
      visibility                         : "public"
      vulnerabilityAlerts                : true
      webCommitSignoffRequired           : false
  }
Resources:
  - 1 to delete
  6 unchanged
  

@kin0992
kin0992 merged commit bdfed7f into main Jun 1, 2026
7 checks passed
@kin0992
kin0992 deleted the provenance-trusted-publishing branch June 1, 2026 21:56
kin0992 added a commit that referenced this pull request Jun 1, 2026
## What

Adds a `patch` changeset for all four publishable packages:

- `@kin0992/oxc-config`
- `@kin0992/skills`
- `@kin0992/tsconfig`
- `@kin0992/vitest-config`

No functional changes — this exists to cut a fresh release so the next
publish attaches **signed provenance** (npm Trusted Publishing / OIDC),
which the current versions lack.

## Release flow

Merging this PR triggers the release workflow, which opens a "Version
Packages" PR bumping each package by a patch. Merging **that** PR
publishes to npmjs.org with provenance.

## ⚠️ Prerequisite

Trusted Publishing must already be configured on npmjs.org for each of
the four packages (GitHub Actions → `kin0992/dev-toolkit` →
`release.yml`), and PR #40 must be merged first — otherwise the publish
step fails auth. Provenance attaches on this publish; existing versions
can't be back-filled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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