Commit 2120646
ci: publish via npm trusted publishing (OIDC) (#770)
## Summary
Switch npm releases from the long-lived `NPM_TOKEN_ELEVATED` secret to
[npm trusted publishing](https://docs.npmjs.com/trusted-publishers/)
(GitHub Actions OIDC), following
[vercel/nft#585](vercel/nft#585).
## Changes (`.github/workflows/ci.yml`)
- Drop `NPM_TOKEN` and `NPM_CONFIG_PROVENANCE` — OIDC handles auth and
provenance attestations are automatic under trusted publishing.
- Run the release on **Node 22** (trusted publishing requires Node ≥
22.14). The release matrix entry moves `20 → 22`.
- **Upgrade npm before releasing** (`npm install -g npm@latest`):
`actions/setup-node` ships npm 10.x, but OIDC trusted publishing needs
npm ≥ 11.5.1, or it silently falls back / 404s on publish. This is the
step the nft PR omitted.
- Update the `id-token: write` comment.
`package.json` already has the object-form `repository.url` that npm
uses to verify the repo during OIDC, so no change there (nft had to add
this).
## Prerequisites (before merge / first release)
Configure a trusted publisher on npm for `satori`:
1. Package settings → Trusted publishing
2. Provider: **GitHub Actions**
3. Repository: `vercel/satori`
4. Workflow filename: `ci.yml`
After the first successful OIDC publish, consider restricting publishing
access to disallow tokens.
## Note
The test matrix changes from `[18, 20]` to `[18, 22]` (Node 20 test
coverage replaced by 22). Happy to run `[18, 20, 22]` instead if we want
to keep 20.
## Test plan
- [ ] Trusted publisher configured on npmjs.com for workflow `ci.yml`
- [ ] Merge to `main` and confirm semantic-release publishes without
`NPM_TOKEN`
- [ ] Verify published package includes provenance attestations
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 2d3af44 commit 2120646
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | | - | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 75 | + | |
0 commit comments