Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/validate-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ name: Validate task
# The fleet validation gate, hosted here once and reached by every repo's test-pull-request stub and its own publish-release stub.
# Three jobs: lint (the fleet doc-lint block plus language lint by tree detection, the prose gate, and the repo gate), unit-test (a generic dotnet test or uv run pytest, skipped where the caller has no test project), and validate (the validate hook, a repo's own domain checks such as an ESPHome compile, a Hugo build, a KiCad ERC, a codegen-drift check, or PowerShell tests).
# No permissions beyond contents: read where a job needs one, since every job here only checks out and reads.
# No required inputs, and CODECOV_TOKEN is the one optional secret, since coverage upload is best-effort.
# No required inputs, markdown-exclude-globs is the one optional input, and CODECOV_TOKEN is the one optional secret, since coverage upload is best-effort.
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved
# Hub-owned gates and default hooks resolve through $/ at the reusable workflow's commit, so each implementation is reproducible against the caller's released pin without a second checkout.
on:
workflow_call:
inputs:
# Appended after '**/*.md' rather than replacing it, so a caller only ever narrows the default rather than restating it.
# A repo that vendors a theme or imports content it does not author excludes that tree here instead of failing the gate on prose it cannot fix.
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved
markdown-exclude-globs:
description: Extra globs for the Lint Markdown step, one per line (for example '!content/**'), appended after '**/*.md'.
required: false
Comment thread
ptr727 marked this conversation as resolved.
Resolved
type: string
default: ''
secrets:
CODECOV_TOKEN:
required: false
Expand All @@ -29,10 +37,13 @@ jobs:
fetch-depth: 0

# The fleet doc-lint block, hosted once rather than carried by every repo of every type.
# An empty markdown-exclude-globs leaves a blank line here, which the action's own globs.split(separator).filter(String) drops, so the default caller passes nothing extra.
- name: Lint Markdown step
uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0
with:
globs: '**/*.md'
globs: |
**/*.md
${{ inputs.markdown-exclude-globs }}

# The spell check covers README + HISTORY only, per CODESTYLE.md "Markdown and Spelling".
- name: Spell check step
Expand Down
16 changes: 16 additions & 0 deletions docs/reusable-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,22 @@ jobs:
done
```

A repo that vendors a theme or imports content it does not author narrows the Lint Markdown step's glob instead. Blog carries a WordPress archive and the PaperMod theme, for instance. `.markdownlint-cli2.jsonc` is declared `"fidelity": "verbatim", "whole": true` in `spec/files.json`, so it is not locally editable:
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved

```yaml
validate:
name: Validate sources job
uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@<hub-main-commit-sha> # <release-tag>
permissions:
contents: read
with:
markdown-exclude-globs: |
!content/**
!themes/*/**
```

`validate-task.yml` appends each line after `**/*.md` in the Lint Markdown step's own `globs:` block. A caller only ever narrows the default this way, never restates or replaces it.
Comment thread
ptr727 marked this conversation as resolved.
Resolved

## Adopting the Pure Functions

Neither `get-version-task.yml` nor `publish-plan-task.yml` has a caller-stub snippet of its own, since a caller reaching either one is a job inside a repo's own `publish-release.yml` or a future `build-release-task.yml`, not a standalone top-level workflow. A repo whose publisher reads NBGV's version outputs directly, without carrying the whole release orchestrator, reaches `get-version-task.yml` by pin in place of its own copy:
Expand Down