You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm publish lacks trusted publishing and provenance — Medium
Problem
.github/workflows/release.yml:49 runs npm publish without OIDC trusted publishing wired to the publish job. id-token: write is scoped to the release-please job only; publish has contents: read.
Fix
Add id-token: write to the publish job's permissions block.
Change the publish step to npm publish --provenance --access public.
Register elastic/cli as a trusted publisher on npmjs.org (package settings → Publishing → Trusted Publishers).
This removes any need for a long-lived NPM_TOKEN and gives downstream consumers cryptographic attestation linking each published tarball to this repo + commit + workflow.
Risk
Medium. Without trusted publishing, authenticating publish requires a long-lived NPM_TOKEN secret. Any step in the release workflow could exfiltrate it and publish outside GitHub Actions. Trusted publishing avoids the secret and provides verifiable build provenance.
Activity
chore: adjust permissions for npm publish (#290)