From 6e39072b086c45bf80d6c56b8299524acc16a908 Mon Sep 17 00:00:00 2001 From: Yiming Li Date: Mon, 15 Jun 2026 11:34:19 +0800 Subject: [PATCH 1/3] fix(ci): unblock API docs auto-PR on cspell Add 'openui' to the cspell dictionary (auto-generated genui API docs use it as an identifier) and set HUSKY=0 on the Create Pull Request step so the peter-evans action's internal commit skips the pre-commit hook, equivalent to 'git commit -n'. --- .github/workflows/update-api-docs.yml | 6 ++++++ cspell.json | 1 + 2 files changed, 7 insertions(+) diff --git a/.github/workflows/update-api-docs.yml b/.github/workflows/update-api-docs.yml index 1c8ab4dcb..8496d278c 100644 --- a/.github/workflows/update-api-docs.yml +++ b/.github/workflows/update-api-docs.yml @@ -74,6 +74,12 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7 + # The action runs its own `git commit`, which triggers the husky + # pre-commit hook (lint-staged → cspell/prettier). On auto-generated + # docs that hook can fail on harmless unknown words and abort the run. + # HUSKY=0 skips the hook for this commit — equivalent to `git commit -n`. + env: + HUSKY: '0' with: branch: bot/update-api-docs delete-branch: true diff --git a/cspell.json b/cspell.json index c36ad178c..f79f9e0f4 100644 --- a/cspell.json +++ b/cspell.json @@ -47,6 +47,7 @@ "rstest", "tiktoken", "genui", + "openui", "impls" ], "maxNumberOfProblems": 1000, From 68eca425150129597872bcdacdf5bdbc19884e03 Mon Sep 17 00:00:00 2001 From: Yiming Li Date: Mon, 15 Jun 2026 11:44:49 +0800 Subject: [PATCH 2/3] fix(ci): keep asset-URL check when skipping pre-commit hook HUSKY=0 skips the whole pre-commit hook, including check-asset-urls.mjs. Run that checker explicitly on the generated docs before creating the PR so internal asset URLs can't leak into the public site unvalidated (addresses Codex review). --- .github/workflows/update-api-docs.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/update-api-docs.yml b/.github/workflows/update-api-docs.yml index 8496d278c..d14dabb3c 100644 --- a/.github/workflows/update-api-docs.yml +++ b/.github/workflows/update-api-docs.yml @@ -72,6 +72,14 @@ jobs: continue-on-error: true run: pnpm run build + - name: Validate generated docs + # The Create Pull Request step below runs with HUSKY=0, which skips the + # whole pre-commit hook. cspell/prettier are noise on auto-generated + # docs, but check-asset-urls.mjs is a real guard against internal asset + # URLs leaking into the public site — and GITHUB_TOKEN PRs don't trigger + # CI, so re-run it explicitly here as a hard gate before the PR is made. + run: node scripts/ci/check-asset-urls.mjs $(find docs/en/api docs/zh/api -type f) + - name: Create Pull Request uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7 # The action runs its own `git commit`, which triggers the husky From a2a29a6b490a2dbf4e5dbfb5bb8cd9011065bc48 Mon Sep 17 00:00:00 2001 From: Yiming Li Date: Mon, 15 Jun 2026 11:49:19 +0800 Subject: [PATCH 3/3] fix(ci): drop duplicated asset-URL check from workflow Re-implementing a husky/lint-staged check inside the workflow duplicates logic that can drift whenever the pre-commit setup changes. Keep HUSKY=0 to skip the hook; rely on the draft PR review (and any CI on it) to catch issues instead. --- .github/workflows/update-api-docs.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/update-api-docs.yml b/.github/workflows/update-api-docs.yml index d14dabb3c..8496d278c 100644 --- a/.github/workflows/update-api-docs.yml +++ b/.github/workflows/update-api-docs.yml @@ -72,14 +72,6 @@ jobs: continue-on-error: true run: pnpm run build - - name: Validate generated docs - # The Create Pull Request step below runs with HUSKY=0, which skips the - # whole pre-commit hook. cspell/prettier are noise on auto-generated - # docs, but check-asset-urls.mjs is a real guard against internal asset - # URLs leaking into the public site — and GITHUB_TOKEN PRs don't trigger - # CI, so re-run it explicitly here as a hard gate before the PR is made. - run: node scripts/ci/check-asset-urls.mjs $(find docs/en/api docs/zh/api -type f) - - name: Create Pull Request uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7 # The action runs its own `git commit`, which triggers the husky