Skip to content

Commit 258972f

Browse files
chore(ci): switch publish workflow to npm OIDC trusted publishing (#61)
Drops the rotating NPM_TOKEN secret in favor of npm's OIDC trusted-publisher flow. The id-token: write permission was already declared on this job; this PR completes the swap by removing NODE_AUTH_TOKEN (no longer needed) and adding --provenance so each published version carries a signed attestation back to this workflow + tag. Trusted publisher must be configured at npmjs.com side first (Settings > Trusted Publishers > GitHub Actions, org=tangle-network, repo=agent-integrations, workflow=publish.yml) — completed before this PR landed. Fixes the E404-on-PUT failure mode that has blocked v0.29.0, v0.30.0, and v0.31.0 publishes. Co-authored-by: Drew Stone <hello@tangle.tools>
1 parent 31a23c5 commit 258972f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,18 @@ jobs:
6666
- run: pnpm run build
6767

6868
# Idempotent: re-running a tag whose npm version is already published
69-
# must not fail the workflow.
69+
# must not fail the workflow. Auth is npm OIDC trusted publishing —
70+
# configured at npmjs.com/package/@tangle-network/agent-integrations/access
71+
# → Trusted Publishers → GitHub Actions (org=tangle-network,
72+
# repo=agent-integrations, workflow=publish.yml). The id-token: write
73+
# permission on this job exchanges a GitHub OIDC token for an
74+
# npm-side publish credential at request time. No NPM_TOKEN secret.
7075
- name: Publish to npm (skip if already published)
7176
run: |
7277
NAME=$(node -p "require('./package.json').name")
7378
VERSION=$(node -p "require('./package.json').version")
7479
if npm view "$NAME@$VERSION" version >/dev/null 2>&1; then
7580
echo "$NAME@$VERSION already on registry; skipping publish"
7681
else
77-
pnpm publish --no-git-checks --access public
82+
pnpm publish --no-git-checks --access public --provenance
7883
fi
79-
env:
80-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)