ci: Docs/changeset-release 在 npm ci 后先 build workspaces - #95
Merged
Conversation
tools 迁到 packages/tools/ 后,paths.mjs 运行时 import @sfmc-bds/sdk/node/config, 需要 SDK dist/ 存在。OOTB 已有 build 步骤;Docs 与 changeset-release 仅 npm ci 导致 ERR_MODULE_NOT_FOUND。与 ootb.yml 对齐,在 npm ci 后增加 npm run build --workspaces --if-present。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
Tanya7z
marked this pull request as ready for review
August 5, 2026 18:54
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.
问题
tools/迁到packages/tools/后,packages/tools/lib/paths.mjs在运行时 import@sfmc-bds/sdk/node/config,需要 SDK 的dist/已存在。OOTB workflow 在
npm ci后会执行npm run build --workspaces --if-present,因此能通过。但 Docs 与 changeset-release 只跑了npm ci,随后执行npm run docs -- build或node packages/tools/build-publishable.mjs时会报错:修复
在以下 workflow 的
npm ci之后、调用 tools 脚本之前,增加与ootb.yml一致的 build 步骤:.github/workflows/docs.yml.github/workflows/changeset-release.yml.github/workflows/npm-publish.yml(同类隐患,一并修复)验证
本地
npm ci→npm run build --workspaces --if-present后:import('./packages/tools/lib/paths.mjs')正常node packages/tools/build-publishable.mjs正常