Repository navigation
ci: publish to npm from a release workflow after approval - #523
Merged
Merged
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
There was a problem hiding this comment.
🟡 Changes recommended
Out-of-order release approvals can roll back npm’s latest tags and deployed docs, while noncanonical tags can reach environment-protected approval before validation.
2 open issues
What changed in this PR
Moves npm publishing out of Main into a separate release workflow gated by the npm approval environment.
Changes:
- Builds uncached release artifacts with read-only default permissions.
- Validates tags and packages before publishing, then deploys docs and drafts a GitHub release.
- Updates action pins and removes unused publishing scripts.
| File | Description |
|---|---|
package.json |
Removes obsolete release publishing commands. |
.github/workflows/release.yaml |
Adds approval-gated publishing and downstream release jobs. |
.github/workflows/main.yaml |
Separates artifact building from publishing and updates action pins. |
Review effort: Balanced
tsmith023
reviewed
Dec 4, 2026
tsmith023
approved these changes
Dec 4, 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.

Moves npm publishing out of
main.yamlinto a newrelease.yamlthat runs in annpmenvironment, so each release needs a second person's approval. Same design as weaviate/agents-typescript-client#67 and the C# clients.main.yamlis now namedMainand defaults to a read-only token. A newbuild-packagejob builds the three tarballs and the docs with no dependency cache and uploads them on tag pushes. The oldpublishjob is gone.release-tagstill checks the package versions.release.yamlruns onworkflow_runwhen Main succeeds for a finalvX.Y.Ztag, so it always uses the workflow onmain. Tags such asv3.15.3-wcnever ask for approval. Before publishing it checks, through the GitHub API, that the tag points at the tested commit and that this commit is onmain, and that the files are exactly@weaviate/{core,node,web}at the tag's version. It publishes the tarballs without a checkout, installs or repo scripts, and skips any version already on npm, so a re-run after a partial publish finishes the rest. Separate jobs then deploy the docs and draft the GitHub release.download-artifactv8,upload-artifactv7 andsetup-nodev7.2.0. The unusedrelease:publishscripts are removed.Before merging, a repo admin creates the
npmenvironment (required reviewers, prevent self-review, no admin bypass, branchmainonly). Right after merging, the Trusted Publisher of all three packages on npm changes to workflowrelease.yamland environmentnpm. Then turn on "disallow tokens" and delete theNPM_AUTOMATION_TOKENsecret.The release build still installs with
--no-frozen-lockfile, as before.