Skip to content

Commit 4b202d0

Browse files
committed
ci(spec-check): sparse-checkout @devhelm/openapi-tools from mono
The shared Springdoc preprocessor used by typegen.sh is an internal-only package that is intentionally not published to npm. The previous fallback to `npx --package=@devhelm/openapi-tools` 404'd on every spec-check run once the repository_dispatch fan-out started actually firing. Sparse-checkout packages/openapi-tools from mono with the existing MONOREPO_DISPATCH_TOKEN, build it in-place, and export OPENAPI_TOOLS so typegen.sh picks the explicit-override path instead of the npm fallback. No new secrets, no public npm publish.
1 parent 6e9a4aa commit 4b202d0

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/spec-check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
- uses: actions/setup-python@v5
2121
with:
2222
python-version: '3.13'
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
2326

2427
- name: Download latest OpenAPI spec from monorepo
2528
run: |
@@ -29,10 +32,33 @@ jobs:
2932
env:
3033
GH_TOKEN: ${{ secrets.MONOREPO_DISPATCH_TOKEN }}
3134

35+
# Sparse-checkout the shared OpenAPI preprocessor from mono.
36+
# typegen.sh prefers $OPENAPI_TOOLS → local sibling → npx; without this
37+
# step, CI falls through to `npx @devhelm/openapi-tools` which is
38+
# intentionally unpublished (internal-only package).
39+
- name: Checkout @devhelm/openapi-tools from mono
40+
uses: actions/checkout@v4
41+
with:
42+
repository: devhelmhq/mono
43+
token: ${{ secrets.MONOREPO_DISPATCH_TOKEN }}
44+
path: .mono
45+
sparse-checkout: packages/openapi-tools
46+
sparse-checkout-cone-mode: false
47+
48+
- name: Build @devhelm/openapi-tools
49+
working-directory: .mono/packages/openapi-tools
50+
# mono uses pnpm workspaces; we only need this one package's deps here,
51+
# so install standalone with npm (no lockfile in this subdir).
52+
run: |
53+
npm install --no-package-lock --no-audit --no-fund
54+
npm run build
55+
3256
- run: uv sync
3357
- run: uv run pytest -v
3458

3559
- name: Regenerate types from spec
60+
env:
61+
OPENAPI_TOOLS: node ${{ github.workspace }}/.mono/packages/openapi-tools/dist/cli.js
3662
run: ./scripts/typegen.sh
3763

3864
- name: Check for type changes

0 commit comments

Comments
 (0)