Repository navigation
ci(runtime): publish with npm trusted publishing - #780
Merged
Merged
Conversation
Both runtime packages authenticate through GitHub OIDC trusted publishing instead of NPM_TOKEN. Run 38508434777 failed with E404 on the first package: the secret was present, but the registry no longer accepts that token for publishing. Node 24 is required because trusted publishing needs npm >= 11.5.1, and a precondition step now checks the npm version and the OIDC endpoint. The publish jobs own `id-token: write`, and a version check skips already published versions so a partially successful run can be re-dispatched.
|
PR Title: ci(runtime): publish with npm trusted publishing Commit: 整体评估本次改动把 runtime 两个 npm 包的发布认证从长期 NPM_TOKEN 迁移到 npm trusted publishing(GitHub OIDC):将 id-token: write 从工作流级收敛到两个发布 job,把 Node 升到 24,并用 npm 版本与 OIDC 端点校验替换原来的 token 校验,同时新增“已发布即跳过”的幂等发布保护。整体方向正确、改动自洽,符合最小权限原则。 总结未发现由本次改动引入的正确性、安全或数据完整性缺陷:权限收敛、版本前置校验与幂等跳过逻辑均实现正确。需留意的只是运行环境前提——npm 侧需已为这两个包配置好 trusted publisher,建议在真实发布环境完成一次端到端发布验证。 |
winterfx
marked this pull request as ready for review
October 14, 2026 11:06
eetoc
approved these changes
Oct 14, 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.
Summary
Publish the two runtime npm packages through npm trusted publishing (GitHub OIDC) instead of a long-lived registry token.
runtime-v0.12.0failed in run #38508434777:Verify runtime package versionsandCheck npm tokenboth passed (so the secret is non-empty), thenPublishreturnedA non-empty token that the registry rejects produces exactly this 404 for a scoped package, and npm is now restricting bypass-2FA tokens for direct publishing. Trusted publishing removes the token from the path entirely.
Changes:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}and theCheck npm tokenstep from both publish jobs;Check trusted publishing preconditionsstep that verifies the npm version and thatACTIONS_ID_TOKEN_REQUEST_URLis present, so a missingid-token: writefails before the build instead of at publish time;id-token: writefrom the workflow level to the two publish jobs, so theverifyjob only getscontents: read;Check published versionstep that skipsnpm publishwhen the version already exists, which keeps the workflow re-dispatchable when one package succeeds and the other fails.Both trusted publishers are already registered on npm:
@chaitin-ai/agent-compose-runtimeand@chaitin-ai/agent-compose-runtime-sdk, each bound tochaitin/agent-compose+publish-runtime.ymlwithpublish, stage publishpermissions and no environment restriction.Note for reviewers: the organization-level
NPM_TOKENsecret must stay in place for now.chaitin/ModelKit'snpm_publish.ymlstill uses it, and that workflow runs Node 18 with pnpm 8, so it cannot use OIDC without its own migration.Testing
task lint,task build, andtask testwere not run: this change touches only a CI workflow, with no Go or TypeScript changes.@0.11.0to skip and@0.12.0to publish (0.12.0 is not published yet; the highest published version is 0.11.0).workflow_dispatchrun after this merges; draft PRs skip CI and no workflow run covers this path.Checklist
docs/pages.secrets.NPM_TOKEN.