Repository navigation
Find Hugo configs in the _preview/ sub-tree in Check Links - #827
Conversation
The "Detect docs site" step looked for a Hugo config only directly in `docs/` or `site/`, or in their `config/` or `config/_default/`. SpineEventEngine/validation keeps its only Hugo config in `docs/_preview/hugo.toml`, so the step reported "No Hugo site found" and the job passed without checking any links (run 41107674096 on SpineEventEngine/validation#341). The same six config paths now also count under `$dir/_preview/`. The `work_dir` logic is unchanged: it already picks `$dir/_preview` when that directory has a `package-lock.json`, and validation's config is there. Checked by running the step's script, before and after, against: - validation at c72021e: no site → `work_dir=docs/_preview`; - documentation at 3f69c93 (`docs/hugo.toml` and `docs/_preview/hugo.toml`): `work_dir=docs/_preview` both times; - fixtures: `docs/hugo.toml` with `docs/package-lock.json` (`work_dir=docs`, unchanged), `site/_preview/config/_default/hugo.yaml` with a lockfile (`work_dir=site/_preview`), a `_preview/` config without a lockfile (skipped with the "no package-lock.json" notice), and no site at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approved
No active review issues are reported for the workflow’s added support for Hugo configurations under _preview/.
No open issues 🎉
What changed in this PR
Updates the shared Check Links workflow to recognize Hugo sites whose configuration exists only under _preview/, preventing those sites from being skipped.
Changes:
- Adds
_preview/equivalents of all six supported Hugo configuration paths underdocs/andsite/. - Documents the additional layout while preserving existing working-directory selection.
| File | Description |
|---|---|
.github/workflows/check-links.yml |
Extends Hugo configuration detection to _preview/ and explains the supported layout. |
Review effort: Balanced
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e75a783988
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Brings in SpineEventEngine/agents#53, the skill side of this PR: the `check-links` skill (step 0) and the `pre-pr` "Hugo site" rule now also find a Hugo config in the site's `_preview/` sub-tree, as the "Detect docs site" step of `check-links.yml` does. Also brings in #52 (Dart Sass in the `check-links` tool requirements) and #51 (no trailing `//` after a one-paragraph proto doc comment). Every hook script wired in `.claude/settings.json` and `.codex/hooks.json` is still present and executable at `01b89c3`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hugo finds a config in `$dir/_preview/` only when it runs there. When that was the only config and the only lockfile was `$dir/package-lock.json`, the detect step fell back to `work_dir=$dir`, and the build would fail with "Unable to locate config file". Now the `$dir` fallback applies to site-root configs only, and a `_preview/` config without `$dir/_preview/package-lock.json` skips the check, like any config without a lockfile to build it with. The skip notice now names the config it found. "No package-lock.json found" would be wrong in this case, because there is one, just not where Hugo can use it. Raised by the Codex review on #827. Checked by running the step's script against validation (`docs/_preview`), documentation (`docs/_preview`), and fixtures. Only that layout changes its outcome: `work_dir=docs` → skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in SpineEventEngine/agents#54, the skill side of the previous commit: step 0 of the `check-links` skill now builds a `_preview/` Hugo config only from `_preview/`, as the "Detect docs site" step of `check-links.yml` does. #54 changes only `skills/check-links/SKILL.md`, so the hook scripts wired in `.claude/settings.json` and `.codex/hooks.json` are as they were at `01b89c3`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Detect docs site" step in
check-links.ymllooked for a Hugo config only directly indocs/orsite/, or in theirconfig/orconfig/_default/. SpineEventEngine/validation keeps its only Hugo config indocs/_preview/hugo.toml. So its job printedNo Hugo site found under docs/ or site/ — skipping link check.and passed without checking any links (run 41107674096 on SpineEventEngine/validation#341).Change
$dir/_preview/.work_dirlogic is unchanged for site-root configs. It already picks$dir/_previewwhen that directory has apackage-lock.json, and validation's config is there._preview/config is built only from_preview/, because Hugo finds it only there. Without$dir/_preview/package-lock.json, the check is skipped instead of falling back to$dir. This came from the Codex review.Found docs/_preview/hugo.toml but no package-lock.json to build it with.Verification
I pulled the step's
run:script out of the workflow, before and after this change, and ran it withGITHUB_OUTPUTpointing to a temp file:c72021e(docs/_preview/hugo.toml)present=falsepresent=true,work_dir=docs/_preview3f69c93(docs/hugo.tomlanddocs/_preview/hugo.toml)work_dir=docs/_previewwork_dir=docs/_previewdocs/hugo.tomlwithdocs/package-lock.jsonwork_dir=docswork_dir=docssite/_preview/config/_default/hugo.yamlwith a lockfilepresent=falsework_dir=site/_previewdocs/_preview/hugo.toml, no lockfilepresent=false("no Hugo site")present=false("Found docs/_preview/hugo.toml but no package-lock.json …")docs/_preview/hugo.tomlwith onlydocs/package-lock.jsonpresent=false("no Hugo site")present=false(same notice)present=falsepresent=falseactionlint1.7.12 reports nothing on the changed workflow.Rollout
validation is a JVM repo, so
migratecopiescheck-links.ymlto it throughcopy_workflows. Its link check starts working after its next./config/pull. Its current copy is also behind on Hugo 0.169.0 and Dart Sass, and that pull brings those too.Not changed:
migratemigratesetsIS_HUGO_DOCSwith the same detection and has the same gap. It does not affect validation, because JVM repos getcheck-links.ymlanyway, and validation'slychee.tomlalready matches config's. A Hugo-only repo that keeps its config only in_preview/would get nocheck-links.ymlorlychee.toml. I leftmigratealone, because for a Hugo-only repo, settingIS_HUGO_DOCSalso switches.claude/settings.jsonto the Hugo set and deletes the JVM workflows. That needs a check of which repos it would reclassify.The matching change to the
check-linksandpre-prskills is in SpineEventEngine/agents#53, and the matching fix for the Codex finding is in SpineEventEngine/agents#54. Both are merged. This PR bumps.agents/sharedto551ad4f, the commit that merged the latter. The bump also brings in SpineEventEngine/agents#52 (Dart Sass in thecheck-linkstool requirements) and SpineEventEngine/agents#51 (proto doc comment rule), and all hook scripts that config wires up are still present and executable there.🤖 Generated with Claude Code