Skip to content

Commit 8c8ee67

Browse files
Restore documentation linter
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4c299ab commit 8c8ee67

1 file changed

Lines changed: 31 additions & 23 deletions

File tree

.github/workflows/Build-Docs.yml

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
permissions:
1212
contents: read # to checkout the repo
13+
statuses: write # to create commit status
1314

1415
jobs:
1516
Build-Docs:
@@ -78,31 +79,38 @@ jobs:
7879
}
7980
8081
- name: Lint documentation
81-
id: markdownlint
82-
uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0
83-
with:
84-
config: .github/linters/.markdown-lint.yml
85-
globs: ${{ fromJson(inputs.Settings).WorkingDirectory }}/outputs/docs/**/*.md
82+
id: super-linter
83+
uses: super-linter/super-linter/slim@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0
84+
env:
85+
RUN_LOCAL: true
86+
DEFAULT_BRANCH: main
87+
DEFAULT_WORKSPACE: ${{ fromJson(inputs.Settings).WorkingDirectory }}
88+
FILTER_REGEX_INCLUDE: ${{ fromJson(inputs.Settings).WorkingDirectory }}/outputs/docs
89+
ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true
90+
GITHUB_TOKEN: ${{ github.token }}
91+
VALIDATE_ALL_CODEBASE: true
92+
VALIDATE_BIOME_FORMAT: false
93+
VALIDATE_BIOME_LINT: false
94+
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
95+
VALIDATE_GITLEAKS: false
96+
VALIDATE_JSCPD: false
97+
VALIDATE_JSON_PRETTIER: false
98+
VALIDATE_MARKDOWN_PRETTIER: false
99+
VALIDATE_YAML_PRETTIER: false
100+
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: false
101+
SAVE_SUPER_LINTER_SUMMARY: true
86102

87-
- name: Summarize documentation lint
88-
if: always()
103+
- name: Post super-linter summary
104+
if: failure() || fromJson(inputs.Settings).Build.Docs.ShowSummaryOnSuccess == true
89105
shell: pwsh
90106
env:
91-
LINT_OUTCOME: ${{ steps.markdownlint.outcome }}
92-
WORKING_DIRECTORY: ${{ fromJson(inputs.Settings).WorkingDirectory }}
107+
SUPER_LINTER_OUTCOME: ${{ steps.super-linter.outcome }}
93108
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-
}
109+
$summaryPath = Join-Path $env:GITHUB_WORKSPACE 'super-linter-output' 'super-linter-summary.md'
110+
Get-Content $summaryPath | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8
100111
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
112+
$failed = $env:SUPER_LINTER_OUTCOME -eq 'failure'
113+
if ($failed) {
114+
Write-Host "::error::Super-linter found issues. Please review the summary above."
115+
exit 1
116+
}

0 commit comments

Comments
 (0)