Skip to content

Commit 597c313

Browse files
committed
fix: use npm Trusted Publishing instead of NPM_TOKEN
Remove NODE_AUTH_TOKEN from the publish workflow so GitHub Actions authenticates via OIDC. Document one-time trusted publisher setup.
1 parent c29a1b5 commit 597c313

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ jobs:
2626
- run: npm run typecheck
2727
- run: npm test
2828
- run: npm run build
29-
- run: npm publish --provenance
30-
env:
31-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
# Uses npm Trusted Publishing (OIDC)
30+
- run: npm publish

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ Maintainers follow this checklist for each release:
6262
npm pack --dry-run
6363
```
6464
4. Commit, tag (`vX.Y.Z`), and push the tag
65-
5. Create a [GitHub Release](https://github.com/vegtelenseg/sentinel/releases/new) from the tag — [`.github/workflows/publish.yml`](./.github/workflows/publish.yml) publishes to npm with provenance
65+
5. Create a [GitHub Release](https://github.com/vegtelenseg/sentinel/releases/new) from the tag — [`.github/workflows/publish.yml`](./.github/workflows/publish.yml) publishes to npm via [Trusted Publishing](https://docs.npmjs.com/trusted-publishers/) (OIDC; provenance is generated automatically)
66+
67+
**npm Trusted Publishing (one-time):** On [npmjs.com](https://www.npmjs.com/)`@siremzam/sentinel`**Settings****Trusted publishing****GitHub Actions** → repository `vegtelenseg/sentinel`, workflow filename `publish.yml`.
68+
69+
Do **not** publish from your laptop with `--provenance` — that flag only works in CI. To publish manually (emergency only): `npm login` then `npm publish --access public` (no `--provenance`).
6670

6771
Patch releases (0.4.x) are non-breaking. Major releases (1.0.0+) follow the [API stability policy](./docs/introduction/api-stability.md).
6872

0 commit comments

Comments
 (0)