Skip to content

Commit 37797cf

Browse files
beefoclaude
andcommitted
add NPM_TOKEN for auth, keep OIDC for provenance attestation
npm Trusted Publishing provides provenance but still requires a Granular Access Token for authentication (unlike PyPI). Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent f8293cc commit 37797cf

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/publish.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Publishes the package to npm when a GitHub Release is created.
2-
# Uses npm Trusted Publishing (OIDC) — no static token needed.
2+
# Uses a Granular Access Token for auth + OIDC for provenance attestation.
33
#
4-
# Setup (one-time on npmjs.com):
5-
# 1. Go to https://www.npmjs.com/package/mg-api-js/access
6-
# 2. Under "Publishing access" → Configure Trusted Publishing
7-
# 3. Add a new trusted publisher:
8-
# - Repository owner: Geotab
9-
# - Repository name: mg-api-js
10-
# - Workflow filename: publish.yml
11-
# - Environment: (leave blank)
4+
# Setup:
5+
# 1. Create a Granular Access Token on npmjs.com:
6+
# Settings → Access Tokens → Generate New Token → Granular Access Token
7+
# Scope it to read+write on the mg-api-js package only
8+
# 2. Add it as a GitHub repository secret named NPM_TOKEN:
9+
# Settings → Secrets and variables → Actions → New repository secret
10+
# 3. (Optional) Configure Trusted Publishing on npmjs.com for provenance:
11+
# https://www.npmjs.com/package/mg-api-js/access → Trusted Publishing
12+
# Repository owner: Geotab, Repository: mg-api-js, Workflow: publish.yml
1213
#
1314
# Usage:
1415
# 1. Bump the version: npm version patch|minor|major
@@ -59,3 +60,5 @@ jobs:
5960
6061
- name: Publish to npm with provenance
6162
run: npm publish --provenance --access public
63+
env:
64+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)