Repository navigation
fix: upgrade npm in publish workflow so trusted publishing works - #111
Merged
Merged
Conversation
Trusted publishing (OIDC) requires npm >= 11.5.1, but Node 22 bundles npm 10.9.x, which ignores OIDC and sends the setup-node placeholder token, so publishes fail with E404.
setu4993
marked this pull request as ready for review
November 14, 2026 00:04
setu4993
enabled auto-merge (squash)
November 14, 2026 00:05
nishank-bhatnagar
approved these changes
Nov 14, 2026
setu4993
disabled auto-merge
November 14, 2026 00:13
2 of 4 tasks
setu4993
added a commit
that referenced
this pull request
Nov 14, 2026
) ## Summary - `scripts/publish.mjs` now sets `repository` (`git+https://github.com/salesforce/agentscript.git` plus the package's `directory`) on every non-private workspace package before `pnpm -r publish`. - With trusted publishing working (#111), npm generates a provenance attestation, and the registry validates `package.json` `repository.url` against the repo in that attestation. None of the public packages declare `repository`, so the publish for #111 failed with: > E422 Unprocessable Entity - PUT .../@sf-agentscript%2fagentforce-dialect - Error verifying sigstore provenance bundle: Failed to validate repository information: package.json: "repository.url" is "", expected to match "https://github.com/salesforce/agentscript" from provenance - Injected at publish time, next to the existing `@agentscript` → `@sf-agentscript` rewrite, so the internal → open source sync can't drop it. It also adds the repo link to the published packages on npmjs.com. ## Test plan - [x] `node --check scripts/publish.mjs` - [x] Read-only run of the new loop against the workspace: 15 public packages, correct `directory` for each; private `docs`, `ui`, `vscode` and the root are skipped - [ ] After merge, the Publish run on main publishes the pending versions (e.g. `agentforce-dialect@2.88.3`) without `E422` - [ ] No `E404` on other packages (would mean that package is missing its trusted publisher config)
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.
Summary
npm@11before publishing.NODE_AUTH_TOKENwritten bysetup-node. The registry rejects that withE404 Not Found - PUT(see the failed run for chore: Sync from internal → open source (2026-11-13) #110, which failed on@sf-agentscript/agentforce-dialect@2.88.3).pnpm publishshells out tonpmfor the upload, so upgrading the global npm is sufficient.Follow-up to #109. Note that #109's description mentions adding
token: ${{ secrets.GITHUB_TOKEN }}tosetup-node; that change is not in the merged workflow and is not needed. #109's run passed only because no package had a new version to publish.Test plan
@sf-agentscript/*packages has a trusted publisher forsalesforce/agentscriptwith workflowpublish.ymland "Allow npm publish" enabledagentforce-dialect@2.88.3) withoutE404/EOTP