Commit dc272cf
ci(release): switch npm publishing to Trusted Publishers (OIDC) (czlonkowski#796)
* ci(release): switch npm publishing to Trusted Publishers (OIDC)
Replace long-lived NPM_TOKEN auth with short-lived OIDC tokens minted
by GitHub Actions via npm Trusted Publishers. Publishes now ship with
provenance attestations linking the package back to the exact workflow
run and commit.
Workflow changes (.github/workflows/release.yml):
- Add `environment: npm-publish` and `permissions: id-token: write` to
publish-npm
- Upgrade runner npm to >= 11.5.1 (Node 20 bundles npm 10.x; Trusted
Publishing requires 11.5.1+)
- Drop NODE_AUTH_TOKEN / NPM_TOKEN; add --provenance to npm publish
Docs (docs/AUTOMATED_RELEASES.md):
- Replace NPM_TOKEN setup with Trusted Publisher configuration steps
- Update troubleshooting and security sections
Preflight (scripts/test-release-automation.js):
- Check for id-token: write and environment: npm-publish instead of
NPM_TOKEN
- Update Next Steps to reference the new auth model
Requires (one-time, before next release):
- npmjs.com: configure Trusted Publisher for repo czlonkowski/n8n-mcp,
workflow release.yml, environment npm-publish
- GitHub: create environment `npm-publish` (no protection rules needed)
- After first successful release, NPM_TOKEN secret can be deleted
Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(release): address Copilot review on PR czlonkowski#796
- Pin runner npm to ^11.5.1 instead of @latest, and echo version after
install for easier troubleshooting. Avoids exposing the release flow
to future npm major releases.
- Scope OIDC preflight checks (id-token: write, environment: npm-publish)
to the publish-npm job block instead of the entire workflow file, so
the checks can't false-positive on keys belonging to other jobs.
Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f1edbc9 commit dc272cf
3 files changed
Lines changed: 76 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
312 | 316 | | |
313 | 317 | | |
314 | 318 | | |
| |||
318 | 322 | | |
319 | 323 | | |
320 | 324 | | |
321 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
322 | 330 | | |
323 | 331 | | |
324 | 332 | | |
| |||
397 | 405 | | |
398 | 406 | | |
399 | 407 | | |
400 | | - | |
401 | | - | |
402 | | - | |
| 408 | + | |
403 | 409 | | |
404 | 410 | | |
405 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | | - | |
| 123 | + | |
123 | 124 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
128 | 142 | | |
129 | 143 | | |
130 | 144 | | |
| |||
230 | 244 | | |
231 | 245 | | |
232 | 246 | | |
233 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
234 | 258 | | |
235 | 259 | | |
236 | 260 | | |
| |||
282 | 306 | | |
283 | 307 | | |
284 | 308 | | |
285 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
286 | 312 | | |
287 | 313 | | |
288 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
423 | | - | |
424 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
425 | 430 | | |
426 | | - | |
427 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
428 | 444 | | |
429 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
430 | 451 | | |
431 | 452 | | |
432 | 453 | | |
| |||
535 | 556 | | |
536 | 557 | | |
537 | 558 | | |
538 | | - | |
539 | | - | |
540 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
541 | 564 | | |
542 | 565 | | |
543 | 566 | | |
| |||
0 commit comments