Skip to content

Commit 77b7c20

Browse files
Nick Ficanoclaude
andcommitted
ci(publish): switch npm auth to OIDC trusted publishers
Trusted publishers are now configured on every @agentruntimecontrolprotocol/* package, so the workflow no longer needs NPM_TOKEN. Dropping the env reference plus setup-node's registry-url keeps ~/.npmrc free of the `_authToken=\${NODE_AUTH_TOKEN}` placeholder that would otherwise pre-empt the OIDC handshake. GitHub Packages auth is unchanged (the second setup-node call still configures npm.pkg.github.com against GITHUB_TOKEN). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 609bb38 commit 77b7c20

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@
44
# root (package.json `"private": true`) is never published.
55
#
66
# Required repo configuration:
7-
# - Secret: NPM_TOKEN (npm automation token with publish rights to the
8-
# @agentruntimecontrolprotocol scope — create at npmjs.com → Access Tokens → Automation)
7+
# - npm Trusted Publisher must be configured on every
8+
# @agentruntimecontrolprotocol/* package (npmjs.com → package → Settings →
9+
# Trusted Publishers) pointing at:
10+
# repository: agentruntimecontrolprotocol/typescript-sdk
11+
# workflow: publish.yml
12+
# environment: (none)
13+
# With trusted publishers in place the workflow authenticates to npm via
14+
# the OIDC token GitHub Actions mints from `id-token: write`; no NPM_TOKEN
15+
# secret is needed.
916
# - The built-in GITHUB_TOKEN is used for GitHub Packages; the job grants
1017
# `packages: write` below.
11-
# - `id-token: write` is required for npm provenance (sigstore OIDC).
18+
# - `id-token: write` is required for both npm publish (trusted publisher
19+
# handshake) and npm provenance (sigstore attestation).
1220

1321
name: publish
1422

@@ -52,13 +60,15 @@ jobs:
5260
version: 9.15.0
5361
run_install: false
5462

55-
- name: Setup Node.js (npm registry)
63+
- name: Setup Node.js
64+
# No registry-url/scope: that would cause setup-node to write an
65+
# `_authToken=${NODE_AUTH_TOKEN}` line into ~/.npmrc, which then
66+
# short-circuits the trusted-publisher OIDC handshake when no token is
67+
# present. The npm publish step passes --registry explicitly instead.
5668
uses: actions/setup-node@v6
5769
with:
5870
node-version: "22"
5971
cache: "pnpm"
60-
registry-url: "https://registry.npmjs.org"
61-
scope: "@agentruntimecontrolprotocol"
6272

6373
- name: Install dependencies
6474
run: pnpm install --frozen-lockfile
@@ -86,8 +96,8 @@ jobs:
8696
cat .publish-dirs.txt
8797
8898
- name: Publish to npm
89-
env:
90-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
99+
# No NODE_AUTH_TOKEN: npm CLI uses the OIDC token from `id-token: write`
100+
# against the npmjs.com trusted-publisher configured for each package.
91101
run: |
92102
set -euo pipefail
93103

0 commit comments

Comments
 (0)