Skip to content

chore(ci): run hugo mod npm pack before building - #216

Merged
Arthurvdv merged 1 commit into
mainfrom
chore/ci-hugo-npm-pack
Nov 8, 2026
Merged

Arthurvdv merged 1 commit into
mainfrom
chore/ci-hugo-npm-pack

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Why

Dependabot npm PRs (e.g. #212) fail the Build with Hugo step with:

ERROR failed to load config: npm dependencies are out of sync, please run "hugo mod npm pack"

Since Hugo 0.159, hugo mod npm pack stores a checksum in packages/hugoautogen/hugo_packagemeta.json. That checksum covers the raw bytes of the project package.json, so any version bump invalidates it. Hugo only warns, but the build runs with --panicOnWarning, which turns the warning into a failure. Regenerating the file on the runner is the only missing piece; for a Dependabot bump the regenerated workspace package is identical and only the checksum changes.

What

Adds a Sync Hugo npm metadata step to the reusable build.yaml (so the PR gate, the Pages deploy and the link check all pick it up) that runs hugo mod npm pack before npm ci.

Running it before npm ci keeps the useful signal: when a Docsy bump genuinely changes module dependencies, npm ci fails with a lock-file mismatch, which does need a human commit.

After merging

Comment @dependabot rebase on #212; the rebased branch picks up the new step and should go green without a manual commit.

🤖 Generated with Claude Code

Hugo hashes the project package.json into packages/hugoautogen/hugo_packagemeta.json
and warns when the stored checksum no longer matches. With --panicOnWarning that
warning fails the build, so every Dependabot npm bump broke CI until someone
committed a regenerated metadata file. Regenerating it on the runner removes that
manual step while keeping --panicOnWarning for real warnings. The step runs before
npm ci, so a genuine change to module dependencies still fails as a lock-file
mismatch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Arthurvdv
Arthurvdv merged commit 7be7652 into main Nov 8, 2026
1 of 2 checks passed
@Arthurvdv
Arthurvdv deleted the chore/ci-hugo-npm-pack branch November 8, 2026 14:34
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