Repository navigation
chore(ci): run hugo mod npm pack before building - #216
Merged
Merged
Conversation
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>
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.
Why
Dependabot npm PRs (e.g. #212) fail the
Build with Hugostep with:Since Hugo 0.159,
hugo mod npm packstores a checksum inpackages/hugoautogen/hugo_packagemeta.json. That checksum covers the raw bytes of the projectpackage.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 metadatastep to the reusablebuild.yaml(so the PR gate, the Pages deploy and the link check all pick it up) that runshugo mod npm packbeforenpm ci.Running it before
npm cikeeps the useful signal: when a Docsy bump genuinely changes module dependencies,npm cifails with a lock-file mismatch, which does need a human commit.After merging
Comment
@dependabot rebaseon #212; the rebased branch picks up the new step and should go green without a manual commit.🤖 Generated with Claude Code