Skip to content

Fix broken Pages deploy and gate PRs with a build - #13

Merged
aschokking merged 1 commit into
mainfrom
fix/ci-gate-and-pnpm-workspace
Oct 3, 2026
Merged

aschokking merged 1 commit into
mainfrom
fix/ci-gate-and-pnpm-workspace

Conversation

@aschokking

Copy link
Copy Markdown
Contributor

Two things: the Pages deploy has been broken for weeks, and nothing builds PRs before merge.

The deploy has been failing since 2026-08-14

Every Deploy to GitHub Pages run on main has failed — 6 in a row, each in 9–17 seconds, before building anything:

Setup Node.js   [command] pnpm store path --silent
Setup Node.js    ERROR  packages field missing or empty
Setup Node.js   ##[error] ERROR  packages field missing or empty

Cause: pnpm-workspace.yaml contains an allowBuilds: key but no packages: field. That shape is pnpm 10+, while both workflows pin pnpm/action-setup@v4 at version: 9. Under pnpm 9 a workspace file without packages: is invalid, and every pnpm command fails — including the pnpm store path that actions/setup-node runs to set up cache: pnpm. So the job dies in Setup Node.js, before install or build.

Reproduced locally: with pnpm 9.15.9 in this repo even pnpm --version fails with the same error. With pnpm 12.8.1 it passes, which is why it works on a dev machine with a newer pnpm.

Fix: add the packages: field, keeping the existing esbuild allowance for newer pnpm.

packages:
  - .

allowBuilds:
  esbuild: true

Verified locally, both pnpm versions

pnpm 9.15.9 pnpm 12.8.1
pnpm store path pass pass
pnpm install --frozen-lockfile pass pass
pnpm docs:build pass pass

pnpm-lock.yaml is untouched by the frozen install under either version.

CI gate

deploy.yml only runs on push to main, so a PR that breaks the site isn't caught until it has already merged. This adds ci.yml, building every PR with the same toolchain as the deploy.

Because VitePress fails the build on dead internal links, this also gates links to pages that don't exist. Confirmed by deliberately pointing a link at a missing page: the build exits 1.

Note

The alternative fix is bumping both workflows to pnpm 10+ instead. I went with the workspace file because it keeps the pinned toolchain unchanged and is verified against both versions — happy to switch if you'd rather move the pin forward.

🤖 Generated with Claude Code

pnpm-workspace.yaml had an allowBuilds key but no packages field. That is a
pnpm 10+ shaped file, while both workflows pin pnpm 9, where a workspace file
without packages is invalid - pnpm 9 fails on any command, including the
"pnpm store path" that setup-node runs for cache: pnpm. Every Deploy run since
2026-08-14 failed in Setup Node.js before building anything, so the site has
not published in weeks.

Adding the packages field makes the file valid for pnpm 9 while keeping the
esbuild allowance for newer pnpm. Verified locally: store path, install
--frozen-lockfile and docs:build all pass under both pnpm 9.15.9 and 12.8.1,
and the lockfile is unchanged.

Also adds a CI workflow so PRs are built before merge instead of discovering
breakage on main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aschokking
aschokking merged commit 02ca4ac into main Oct 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant