Avoid unnecessary workflows, improve check-links detection of Hugo site dir#667
Avoid unnecessary workflows, improve check-links detection of Hugo site dir#667alexander-yevsyukov wants to merge 14 commits into
check-links detection of Hugo site dir#667Conversation
check-links detection of Hugo site dir
There was a problem hiding this comment.
Pull request overview
This PR improves repo-type detection used by shared tooling so that GitHub workflows and the check-links job behave correctly across different Spine repository layouts (JVM vs Hugo-only docs sites).
Changes:
- Add a more reliable JVM/Gradle repository marker in
migrateand gate workflow updates behind it. - Enhance
check-linksworkflow Hugo site detection to support additional Hugo config layouts and to choose the correct working directory (_preview/vs site root). - Refine the
pre-prskill description to reflect scope-dependent build/check behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
migrate |
Adds JVM repo detection and conditionally updates JVM-specific GitHub workflows. |
.github/workflows/check-links.yml |
Improves Hugo site/config discovery and introduces work_dir to run Node/Hugo steps in the right directory. |
.agents/skills/pre-pr/SKILL.md |
Updates the skill description to better describe scope-based build/check behavior and invoked reviewers. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 149c14158d
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 13 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- .idea/live-templates/README.md: Language not supported
- .idea/live-templates/User.xml: Language not supported
- .idea/misc.xml: Language not supported
Comments suppressed due to low confidence (1)
migrate:159
initialize .githubcopies the entire.github/directory (including.github/workflows/*) into the target repo when it doesn't exist yet. Because workflow syncing is now gated behindIS_JVM, a non-JVM target with no pre-existing.github/will still receive JVM-only workflows likedetekt-code-analysis.yml/gradle-wrapper-validation.ymlfrom this initial copy. Consider copying.github/without workflows (or removing JVM workflows) whenIS_JVM=false, and only populating.github/workflowsinside the JVM-gated block.
initialize .github
echo "Updating Codecov settings"
cp .codecov.yml ..
This PR delivers several improvements across
migrate, thecheck-linksworkflow, and thecheck-links/pre-prskills.migratescriptHugo site detection expanded — now checks
config/hugo.{toml,yaml}andconfig/_default/hugo.{toml,yaml}in addition to the site root, matching the detection logic in thecheck-linksworkflow.JVM detection made reliable — uses the presence of
buildSrc/src/main/kotlin/io/spine/dependencyas the marker instead ofgradlew/build.gradle.kts, which can exist in non-JVM repos that wrap shell scripts in Gradle for convenience.Script restructured for mixed projects — the previous binary
if IS_HUGO_DOCS … else … fiassumed a repo is either Hugo or JVM. Repos such asvalidationare both. The script is now four independent, sequentially-executed sections (Common,.agents,.claude, Hugo-specific, JVM-specific), each guarded by its own flag. BothIS_HUGO_DOCSandIS_JVMcan be true simultaneously, and each section applies the right operations for the detected combination.check-linksworkflowwork_diroutput added — the "Detect docs site" step now emits awork_diroutput (either$dir/_previewor$dir) so that all downstream steps use the correct working directory fornpm ci,hugo, and Lychee, regardless of whether the repo's Node/Hugo setup lives in a_preview/subtree or at the site root.Unused
site_diroutput removed — no downstream step referenced it; it is dropped to keep the step contract minimal.YAML config subdir variants added —
config/hugo.yamlandconfig/_default/hugo.yamlare now included in the detection loop alongside the TOML variants.check-linksskillWORK_DIRdetection added to step 0 — mirrors the workflow's_previewvs. site-root logic so that local pre-PR runs and CI use the same working directory.All
${SITE_DIR}/_previewreferences replaced with${WORK_DIR}— affectsnpm ci,hugo build,hugo server, Lychee invocation, path-mapping example, and the Notes section.Config subdir detection aligned with the workflow — step 0 now checks the same six config paths.
pre-prskill*.kt/*.ktsunderbuildSrc) match thecodeclassifier and run./gradlew build. The description now reads "code/deps →build".Scripts
jqpresence check added — scripts that usejqnow verify it is installed and exit with a clear error if not.