-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathmarkdown-linter.md
More file actions
170 lines (135 loc) Β· 4.41 KB
/
markdown-linter.md
File metadata and controls
170 lines (135 loc) Β· 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
---
description: Runs Markdown quality checks using Super Linter and creates issues for violations
on:
workflow_dispatch:
schedule:
- cron: "0 14 * * 1-5" # 2 PM UTC, weekdays only
permissions:
contents: read
actions: read
issues: read
pull-requests: read
safe-outputs:
create-issue:
expires: 2d
title-prefix: "[linter] "
labels: [automation, code-quality]
noop:
name: Markdown Linter
timeout-minutes: 15
imports:
- shared/reporting.md
jobs:
super_linter:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Super-linter
uses: super-linter/super-linter@v8.5.0
id: super-linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CREATE_LOG_FILE: "true"
LOG_FILE: super-linter.log
DEFAULT_BRANCH: main
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: "true"
VALIDATE_MARKDOWN: "true"
VALIDATE_ALL_CODEBASE: "false"
- name: Check for linting issues
id: check-results
run: |
if [ -f "super-linter.log" ] && [ -s "super-linter.log" ]; then
if grep -qE "ERROR|WARN|FAIL" super-linter.log; then
echo "needs-linting=true" >> "$GITHUB_OUTPUT"
else
echo "needs-linting=false" >> "$GITHUB_OUTPUT"
fi
else
echo "needs-linting=false" >> "$GITHUB_OUTPUT"
fi
- name: Upload super-linter log
if: always()
uses: actions/upload-artifact@v7
with:
name: super-linter-log
path: super-linter.log
retention-days: 7
steps:
- name: Download super-linter log
uses: actions/download-artifact@v8
with:
name: super-linter-log
path: /tmp/gh-aw/
tools:
cache-memory: true
edit:
bash:
- "*"
---
# Markdown Quality Report
You are an expert documentation quality analyst. Your task is to analyze the Super Linter Markdown output and create a comprehensive issue report for the repository maintainers.
## Context
- **Repository**: ${{ github.repository }}
- **Triggered by**: @${{ github.actor }}
- **Run ID**: ${{ github.run_id }}
## Your Task
1. **Read the linter output** from `/tmp/gh-aw/super-linter.log` using the bash tool
2. **Analyze the findings**:
- Categorize errors by severity (critical, high, medium, low)
- Identify patterns in the errors
- Determine which errors are most important to fix first
- Note: This workflow only validates Markdown files
3. **Create a detailed issue** with the following structure:
### Issue Title
Use format: "Markdown Quality Report - [Date] - [X] issues found"
### Issue Body Structure
```markdown
## π Markdown Linter Summary
**Date**: [Current date]
**Total Issues Found**: [Number]
**Run ID**: ${{ github.run_id }}
## π Breakdown by Severity
- **Critical**: [Count and brief description]
- **High**: [Count and brief description]
- **Medium**: [Count and brief description]
- **Low**: [Count and brief description]
## π Issues by Category
### [Category/Rule Name]
- **File**: `path/to/file`
- Line [X]: [Error description]
- Suggested fix: [How to resolve]
[Repeat for other categories]
## π― Priority Recommendations
1. [Most critical issue to address first]
2. [Second priority]
3. [Third priority]
## π Full Linter Output
<details>
<summary>Click to expand complete linter log</summary>
```
[Include the full linter output here]
```
</details>
## π References
- [Link to workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
- [Super Linter Documentation](https://github.com/super-linter/super-linter)
```
## Important Guidelines
- **Be concise but thorough**: Focus on actionable insights
- **Prioritize issues**: Not all linting errors are equal
- **Provide context**: Explain why each type of error matters for documentation quality
- **Suggest fixes**: Give practical recommendations
- **Use proper formatting**: Make the issue easy to read and navigate
- **If no errors found**: Call `noop` celebrating clean markdown
**Important**: Always call exactly one safe-output tool before finishing (`create_issue` or `noop`).
```json
{"noop": {"message": "No action needed: [brief explanation of what was analyzed and why]"}}
```