Skip to content

Find Hugo configs in the _preview/ sub-tree in Check Links - #827

Merged
alexander-yevsyukov merged 5 commits into
masterfrom
check-links-preview-config
Nov 2, 2026
Merged

alexander-yevsyukov merged 5 commits into
masterfrom
check-links-preview-config

Conversation

@alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The "Detect docs site" step in check-links.yml 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 its job printed No Hugo site found under docs/ or site/ — skipping link check. and passed without checking any links (run 41107674096 on SpineEventEngine/validation#341).

Change

  • The same six config paths now also count under $dir/_preview/.
  • The work_dir logic is unchanged for site-root configs. It already picks $dir/_preview when that directory has a package-lock.json, and validation's config is there.
  • A _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.
  • The skip notice names the config it found, e.g. 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 with GITHUB_OUTPUT pointing to a temp file:

Checkout / layout Before After
validation c72021e (docs/_preview/hugo.toml) present=false present=true, work_dir=docs/_preview
documentation 3f69c93 (docs/hugo.toml and docs/_preview/hugo.toml) work_dir=docs/_preview work_dir=docs/_preview
docs/hugo.toml with docs/package-lock.json work_dir=docs work_dir=docs
site/_preview/config/_default/hugo.yaml with a lockfile present=false work_dir=site/_preview
docs/_preview/hugo.toml, no lockfile present=false ("no Hugo site") present=false ("Found docs/_preview/hugo.toml but no package-lock.json …")
docs/_preview/hugo.toml with only docs/package-lock.json present=false ("no Hugo site") present=false (same notice)
no site present=false present=false

actionlint 1.7.12 reports nothing on the changed workflow.

Rollout

validation is a JVM repo, so migrate copies check-links.yml to it through copy_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: migrate

migrate sets IS_HUGO_DOCS with the same detection and has the same gap. It does not affect validation, because JVM repos get check-links.yml anyway, and validation's lychee.toml already matches config's. A Hugo-only repo that keeps its config only in _preview/ would get no check-links.yml or lychee.toml. I left migrate alone, because for a Hugo-only repo, setting IS_HUGO_DOCS also switches .claude/settings.json to the Hugo set and deletes the JVM workflows. That needs a check of which repos it would reclassify.

The matching change to the check-links and pre-pr skills 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/shared to 551ad4f, the commit that merged the latter. The bump also brings in SpineEventEngine/agents#52 (Dart Sass in the check-links tool 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

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>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T16:14:21.338033Z e75a783 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 under docs/ and site/.
  • 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .github/workflows/check-links.yml Resolved
@alexander-yevsyukov alexander-yevsyukov self-assigned this Nov 2, 2026
@alexander-yevsyukov alexander-yevsyukov moved this to In Review in v2.0 Nov 2, 2026
alexander-yevsyukov and others added 3 commits November 2, 2026 18:21
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>
@alexander-yevsyukov
alexander-yevsyukov merged commit 3a0d13a into master Nov 2, 2026
3 checks passed
@alexander-yevsyukov
alexander-yevsyukov deleted the check-links-preview-config branch November 2, 2026 16:40
@github-project-automation github-project-automation Bot moved this from In Review to ✅ Done in v2.0 Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants