- Notifications
You must be signed in to change notification settings - Fork 0
Add markdown-exclude-globs Input to validate-task.yml#935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,10 +3,17 @@ 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. | ||
qodo-code-review[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| # 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', not validated: a negated glob excludes, a non-negated one adds to what is linted. | ||
| markdown-exclude-globs: | ||
| description: Negated globs to exclude, one per line (for example '!content/**'), appended after '**/*.md'. A non-negated line adds to what is linted rather than narrowing it. | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| secrets: | ||
| CODECOV_TOKEN: | ||
| required: false | ||
| @@ -29,10 +36,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 ignores, 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 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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: | ||
qodo-code-review[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ```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, unvalidated. A negated glob excludes, the intended use, but a non-negated one adds to what is linted rather than narrowing it. | ||
| ## 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: | ||
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.
Uh oh!
There was an error while loading. Please reload this page.