@@ -147,6 +147,7 @@ jobs:
147147 outputs :
148148 should-run : ${{ steps.determine-strategy.outputs.should_run }}
149149 servers : ${{ steps.determine-strategy.outputs.servers }}
150+ should-lint-markdown : ${{ steps.determine-strategy.outputs.should_lint_markdown }}
150151 steps :
151152 - name : Check out repository
152153 uses : actions/checkout@v4.2.2
@@ -169,15 +170,24 @@ jobs:
169170 files : |
170171 src/**
171172
173+ - name : Check for changes in markdown files
174+ id : check-markdown
175+ uses : tj-actions/changed-files@v46.0.0
176+ with :
177+ files : |
178+ **/*.md
179+
172180 - name : Determine test strategy based on file changes
173181 id : determine-strategy
174182
175183 run : |
176184 workflow_changed="${{ steps.check-workflow.outputs.any_changed }}"
177185 src_changed="${{ steps.check-src.outputs.any_changed }}"
186+ markdown_changed="${{ steps.check-markdown.outputs.any_changed }}"
178187
179188 echo "Workflow changed: $workflow_changed"
180189 echo "Src changed: $src_changed"
190+ echo "Markdown changed: $markdown_changed"
181191
182192 # Initialize final server list
183193 declare -a final_servers=()
@@ -224,12 +234,21 @@ jobs:
224234 echo "No tests needed (no relevant changes)"
225235 fi
226236
237+ # Set markdown lint flag independently
238+ if [[ "$markdown_changed" == "true" || "$workflow_changed" == "true" || "$src_changed" == "true" ]]; then
239+ echo "should_lint_markdown=true" >> "$GITHUB_OUTPUT"
240+ echo "✅ Markdown linting will run"
241+ else
242+ echo "should_lint_markdown=false" >> "$GITHUB_OUTPUT"
243+ echo "⏭️ No markdown changes detected"
244+ fi
245+
227246 lint-markdown :
228247 runs-on : ubuntu-latest
229248 name : Lint Markdown
230249 needs : [check-authorization, check-changes]
231250 if : |
232- needs.check-changes.outputs.should-run == 'true' &&
251+ needs.check-changes.outputs.should-lint-markdown == 'true' &&
233252 ((github.event_name == 'push') ||
234253 (github.event_name == 'pull_request_target' && needs.check-authorization.outputs.authorized == 'true'))
235254 steps :
@@ -742,7 +761,11 @@ jobs:
742761 if [[ "${{ needs.lint-markdown.result }}" == "success" ]]; then
743762 echo "✅ Markdown linting passed"
744763 elif [[ "${{ needs.lint-markdown.result }}" == "skipped" ]]; then
745- echo "⏭️ Markdown linting skipped"
764+ if [[ "${{ needs.check-changes.outputs.should-lint-markdown }}" == "true" ]]; then
765+ echo "❌ Markdown linting was expected but skipped"
766+ exit 1
767+ fi
768+ echo "⏭️ Markdown linting skipped (no markdown changes)"
746769 else
747770 echo "❌ Markdown linting failed"
748771 exit 1
@@ -772,7 +795,8 @@ jobs:
772795
773796 if [[ "${{ needs.check-changes.outputs.should-run }}" == "true" ]]; then
774797 echo "Tested servers: ${{ needs.check-changes.outputs.servers }}"
775- echo "✅ All quality checks passed!"
776- else
777- echo "⏭️ No relevant changes - CI skipped"
778- fi
798+ fi
799+ if [[ "${{ needs.check-changes.outputs.should-lint-markdown }}" == "true" ]]; then
800+ echo "Markdown linting: enabled"
801+ fi
802+ echo "✅ All quality checks passed!"
0 commit comments