Skip to content

Commit 4c299ab

Browse files
Summarize markdown lint results
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 474f158 commit 4c299ab

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

.github/workflows/Build-Docs.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,31 @@ jobs:
7878
}
7979
8080
- name: Lint documentation
81-
uses: DavidAnson/markdownlint-cli2-action@28a7e8bdb81fd8ad675883de92c758ab78e0ce10 # v24
81+
id: markdownlint
82+
uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0
8283
with:
8384
config: .github/linters/.markdown-lint.yml
8485
globs: ${{ fromJson(inputs.Settings).WorkingDirectory }}/outputs/docs/**/*.md
86+
87+
- name: Summarize documentation lint
88+
if: always()
89+
shell: pwsh
90+
env:
91+
LINT_OUTCOME: ${{ steps.markdownlint.outcome }}
92+
WORKING_DIRECTORY: ${{ fromJson(inputs.Settings).WorkingDirectory }}
93+
run: |
94+
$docsPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "$env:WORKING_DIRECTORY/outputs/docs"
95+
$fileCount = if (Test-Path -Path $docsPath) {
96+
@(Get-ChildItem -Path $docsPath -Recurse -File -Include '*.md', '*.markdown').Count
97+
} else {
98+
0
99+
}
100+
101+
@(
102+
'## Documentation lint'
103+
''
104+
'- Tool: `markdownlint-cli2-action v24.2.0`'
105+
'- Configuration: `.github/linters/.markdown-lint.yml`'
106+
"- Files checked: $fileCount"
107+
"- Result: **$env:LINT_OUTCOME**"
108+
) | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append

0 commit comments

Comments
 (0)