summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-14 00:49:50 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-14 00:49:50 +0300
commit1ef5684729646ca3a24aff83ab8edd0aa57914c7 (patch)
treefc89c7d027957b377ad9bb9fd0fa5259f59f9007 /.github/workflows
parent379ed4757b62a7c1df965a59bc4f1fd0cef2d3e8 (diff)
downloadvyos-documentation-1ef5684729646ca3a24aff83ab8edd0aa57914c7.tar.gz
vyos-documentation-1ef5684729646ca3a24aff83ab8edd0aa57914c7.zip
ci(doc-linter): lint added + renamed files, not only modified
Previous workflow: env: FILES_MODIFIED: ${{ steps.file_changes.outputs.files_modified }} run: python scripts/doc-linter.py "$FILES_MODIFIED" `trilom/file-changes-action`'s `files_modified` output is modifications-only. A PR adding a new `.md`/`.rst` doc page passed `files_added`, never `files_modified`, so a brand-new page with long lines or real public IPs slipped past the linter entirely. Workflow: also pass `files_added` and `files_renamed` as separate positional args. Each output is a JSON array (action v1.2.4) and is passed via env to avoid shell-quoting issues. Linter: `main()` now accepts one OR multiple positional argv entries, each a JSON array of paths. Arrays are merged and deduplicated before linting. Single-arg invocations remain backward-compatible. Switched from `ast.literal_eval` to `json.loads` — the action's outputs are JSON, and `json.loads` is the right tool (and dodges literal_eval-via-`eval`-substring linter warnings). Test coverage: - Two JSON arrays merge -> single linter run on union. - Empty-string argv entry skipped (no `files_renamed` in many PRs). - Malformed JSON -> falls back to walking DOCS_ROOT. - No argv -> walks DOCS_ROOT. - Single-arg invocation -> backward-compat preserved. Tracked as item 7 of the rolling-side cleanup backlog from PR #2014 / #2019 / #2020 reviews. 🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/lint-doc.yml11
1 files changed, 10 insertions, 1 deletions
diff --git a/.github/workflows/lint-doc.yml b/.github/workflows/lint-doc.yml
index d7f25f38..eb7386d0 100644
--- a/.github/workflows/lint-doc.yml
+++ b/.github/workflows/lint-doc.yml
@@ -30,5 +30,14 @@ jobs:
- name: run doc linter
env:
+ # Pass modified + added + renamed file lists. `files_modified`
+ # alone misses newly-added pages — a PR adding a new doc with
+ # long lines or real public IPs would otherwise slip through.
FILES_MODIFIED: ${{ steps.file_changes.outputs.files_modified }}
- run: python scripts/doc-linter.py "$FILES_MODIFIED"
+ FILES_ADDED: ${{ steps.file_changes.outputs.files_added }}
+ FILES_RENAMED: ${{ steps.file_changes.outputs.files_renamed }}
+ run: |
+ python scripts/doc-linter.py \
+ "$FILES_MODIFIED" \
+ "$FILES_ADDED" \
+ "$FILES_RENAMED"