[DND-1562] Publish @opik/ccsync via trusted publishing (OIDC) instead of NPM_TOKEN - #3
Open
obezpalko wants to merge 1 commit into
Open
[DND-1562] Publish @opik/ccsync via trusted publishing (OIDC) instead of NPM_TOKEN#3obezpalko wants to merge 1 commit into
obezpalko wants to merge 1 commit into
Conversation
The publish workflow authenticated with secrets.NPM_TOKEN. That no longer works: npm revoked all classic tokens on 2025-12-09, and granular write tokens are now capped at a 90-day lifetime, so a stored secret means quarterly rotation or a broken release. Switch to npm trusted publishing — a short-lived OIDC token minted per run: - id-token: write (plus contents: write, which the existing tag-push step needs) on the publish job; npm matches this workflow's filename, publish.yml, against the trusted publisher configured on npmjs.com - Node 18 -> 22.14.0 and npm -> 11.6.2, the trusted-publishing floor - NODE_AUTH_TOKEN dropped; the setup-node _authToken stub is deleted before publishing so npm falls back to the OIDC exchange - package.json gains `repository`, which the automatic provenance attestation requires (the repo is public, so provenance is generated) - checkout/setup-node bumped off the deprecated v3 runtimes Follow-up outside this repo: configure the trusted publisher for @opik/ccsync on npmjs.com (org comet-ml, repo ccsync, workflow publish.yml) before the next release, then delete the NPM_TOKEN secret. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GuySaar8
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
publish.ymlauthenticatednpm publishwithsecrets.NPM_TOKEN. That path is gone:This switches
@opik/ccsyncto npm trusted publishing — a short-lived OIDC token minted per workflow run, nothing stored:id-token: writeon the publish job (pluscontents: write, which the existing tag-push step already needed but never declared). npm matches this workflow's filename,publish.yml, against the trusted publisher configured on npmjs.com.18→22.14.0and npm →11.6.2— trusted publishing requires Node ≥ 22.14.0 / npm ≥ 11.5.1, and Node 22.14.0 still ships npm 10.NODE_AUTH_TOKENremoved. Before publishing we delete the//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}stub thatsetup-nodewrites into~/.npmrc; with no token set npm would otherwise try that empty credential instead of falling back to the OIDC exchange.package.jsongains arepositoryfield. Provenance attestations are generated automatically for trusted publishes from GitHub Actions on public repos, and provenance requires a repository URL matching the publishing repo — without it the publish would fail.actions/checkoutandactions/setup-nodebumped off their deprecated v3 runtimes.Required before the next release: configure the trusted publisher for
@opik/ccsyncon npmjs.com (package Settings → Trusted Publisher → orgcomet-ml, repoccsync, workflow filenamepublish.yml, filename only and case-sensitive). Then enable "disallow token-based publishing" for the package and delete theNPM_TOKENrepo secret.@opik/ccsync@0.1.0already exists on the registry, so a publisher can be attached to it now.Tracked in DND-1562, alongside the same migration for the opik packages (comet-ml/opik#7918).
Testing
yaml.safe_loadon the workflow andjson.loadsonpackage.json— both parse.workflow_dispatch, and it cannot be dry-run pre-merge: OIDC needs the trusted publisher registered on npmjs.com first. It fails closed — if OIDC is not configured,npm publishreturns an auth error rather than silently falling back to a token.comet-ml/opik-mcp(legacy-ts-deploy.yml) andcomet-ml/opik-openclaw(release.yml) already publish this way in production.AI-WATERMARK: yes — Claude Code / Claude Opus 5; scope: the workflow and package.json edits plus this description. Verified against npm's trusted-publishing docs and the npm classic-token revocation changelog.