Description
Currently, the Markdown lint step in the CI workflow runs unconditionally on every build, even when no Markdown files have changed in the PR or commit.
Proposed Enhancement
Add a paths-filter step to detect when Markdown files have changed and only run the Markdown lint step conditionally. This would improve CI efficiency by avoiding unnecessary linting operations.
Implementation Approach
-
Add a paths-filter step using dorny/paths-filter@v2 before the Markdown lint step:
- name: Check for Markdown changes
id: changed
uses: dorny/paths-filter@v2
with:
filters: |
md:
- '**/*.md'
-
Update the Markdown lint step to include a conditional:
- name: Markdown lint
if: steps.changed.outputs.md == 'true'
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e
# ... rest of configuration
Benefits
- Faster CI builds when only non-Markdown files are changed
- Reduced resource usage
- More efficient workflow execution
References
Requested by: @leynos
Description
Currently, the Markdown lint step in the CI workflow runs unconditionally on every build, even when no Markdown files have changed in the PR or commit.
Proposed Enhancement
Add a paths-filter step to detect when Markdown files have changed and only run the Markdown lint step conditionally. This would improve CI efficiency by avoiding unnecessary linting operations.
Implementation Approach
Add a paths-filter step using
dorny/paths-filter@v2before the Markdown lint step:Update the Markdown lint step to include a conditional:
Benefits
References
Requested by: @leynos