Repository navigation
ci: publish to npm with trusted publishing (OIDC) instead of NPM_TOKEN - #45
Merged
Merged
Conversation
## Value Vapi package consumers keep receiving the built release while dependency scripts and build tools lose access to npm publishing credentials. The previous job granted OIDC access during installation and builds, which allowed any code running there to request publishing credentials. ## What changed Build, validation, version checks and packing run without OIDC permission. The package tarball is uploaded as an artifact. A separate publish job has only `id-token: write`, downloads that artifact and publishes it with lifecycle scripts disabled. It performs no checkout, dependency installation or build, and Node package-manager caching is disabled. Artifact transfer and privileged setup actions are pinned to immutable commits. The workflow filename stays the same, so the npm trusted publisher configured on October 27 remains applicable. npm requires a first successful publish within 48 hours of creation. Recreate the configuration if it expires before that release. Existing npm token secrets remain until OIDC publication succeeds. Library and widget builds pass. The packed widget contains the built library, declarations and embed script. Uploaded tarballs are retained for one day. If a failed publish is retried after that, re-run all jobs to recreate the artifact. ## Testing plan - actionlint and whitespace validation pass. - Actual package builds and packed artifact contents checked locally. - Tarballs exercised in dry-run mode against a disposable local registry from a clean directory without a checkout or dependencies. - A fixture with deliberately failing lifecycle hooks fails normal packing and succeeds with scripts disabled during pack and publish dry-run. No new version was published and no real OIDC release was triggered by this change. Final OIDC verification happens on the next intended release. Build checks use Node 22.22.3. Artifact publishing smoke checks use Node 24.19.0 with npm 12.2.1 and a disposable local registry. The workflow uses Node 24 with its bundled npm.
dhruva-vapi
force-pushed
the
dr/npm-trusted-publishing
branch
from
October 27, 2026 16:41
0480a34 to
51c327f
Compare
shuaib-ahmed-vapi
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Value
Vapi package consumers keep receiving the built release while dependency scripts and build tools lose access to npm publishing credentials. The previous job granted OIDC access during installation and builds, which allowed any code running there to request publishing credentials.
What changed
Build, validation, version checks and packing run without OIDC permission. The package tarball is uploaded as an artifact. A separate publish job has only
id-token: write, downloads that artifact and publishes it with lifecycle scripts disabled. It performs no checkout, dependency installation or build, and Node package-manager caching is disabled. Artifact transfer and privileged setup actions are pinned to immutable commits.The workflow filename stays the same, so the npm trusted publisher configured on October 27 remains applicable. npm requires a first successful publish within 48 hours of creation. Recreate the configuration if it expires before that release. Existing npm token secrets remain until OIDC publication succeeds.
Library and widget builds pass. The packed widget contains the built library, declarations and embed script.
Uploaded tarballs are retained for one day. If a failed publish is retried after that, re-run all jobs to recreate the artifact.
Testing plan
No new version was published and no real OIDC release was triggered by this change. Final OIDC verification happens on the next intended release. Build checks use Node 22.22.3. Artifact publishing smoke checks use Node 24.19.0 with npm 12.2.1 and a disposable local registry. The workflow uses Node 24 with its bundled npm.