Skip to content

ci: migrate npm publication from NPM_TOKEN to Trusted Publisher OIDC #45

Closed

Description

@abruption

Problem

The Release Please publish job currently uses a long-lived NPM_TOKEN secret and Node 22.13.0. npm Trusted Publishing requires npm CLI >=11.5.1 and Node >=22.14.0; the current job cannot publish via OIDC as configured.

Scope and rollout

  • Configure the codex-unlock npm package Trusted Publisher for GitHub Actions: owner abruption, repository codex-unlock, workflow filename release-please.yml, no environment unless the workflow is updated to use the exact same environment, and allow direct npm publish. The package owner must handle npm PassKey/2FA in the browser.
  • Update only the tagged Release Please publish job to a supported Node/npm toolchain, retain id-token: write, GitHub-hosted runner and tagged checkout, disable release-build dependency cache, and remove NODE_AUTH_TOKEN/NPM_TOKEN from the publish step. Keep the existing tests, package smoke, and provenance verification.
  • Document the exact npm-side binding, prerequisites, OIDC troubleshooting, and an explicit no-merge-before-npm-binding gate. Do not log or copy a token.
  • On the first post-migration release, verify GitHub release/tag, npm version, successful OIDC publish and provenance/attestations, plus clean install/signature smoke. If OIDC fails, diagnose and retry the existing release rather than minting a version solely for credentials.
  • Only after a successful OIDC publication, remove the unused GitHub NPM_TOKEN secret and revoke the old npm publish token; report these as separately verified follow-up steps. Do not silently change package access/2FA settings.

Acceptance

  • Trusted Publisher connection exists with exact owner/repo/workflow and direct publish permission.
  • CI publish job uses Node >=22.14 and npm >=11.5.1, with id-token: write and no publish token reference.
  • Documentation and release guard reflect OIDC and staged token retirement.
  • Workflow/static checks pass; a real tagged release proves OIDC and provenance.
  • Existing token/secret retired only after successful OIDC publish.

References: https://docs.npmjs.com/trusted-publishers and https://www.npmjs.com/package/codex-unlock/access

Activity

  1. added
    enhancement
    on Sep 27, 2026
  2. abruption commented on Sep 27, 2026

    @abruption
    OwnerAuthor

    npm package Settings에서 Trusted Publisher 연결이 생성된 것을 확인했습니다: GitHub Actions abruption/codex-unlock, workflow release-please.yml, direct npm publish 및 npm stage publish 허용. PassKey는 패키지 소유자가 직접 처리했습니다. 코드 변경은 draft PR #46이며, 첫 실제 OIDC 태그 릴리스와 기존 토큰/secret 폐기는 아직 미검증·미수행입니다.

  3. abruption commented on Sep 28, 2026

    @abruption
    OwnerAuthor

    Completed.

    • The Release Please publish job uses npm Trusted Publishing (OIDC) with id-token: write and no publish token (ci: prepare npm Trusted Publisher release #46).
    • [email protected] was published by the GitHub Actions trusted publisher with provenance.
    • The GitHub NPM_TOKEN secret has been removed, and the previous npm publish tokens have been revoked by the maintainer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions