Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/reusable-docs-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,30 @@ jobs:
exit 1
fi
- name: Check whether docs exists and contains a README
id: check-readme
run: |
if [ -d "./docs" ]; then
echo "Folder exists."
if [ ! -f "./docs/readme.md" ]; then
echo "❌ docs/readme.md file is missing"
exit 1
# Check for other markdown files in docs and its subfolders
md_count=$(find ./docs -type f -name "*.md" | wc -l)
if [ "$md_count" -gt 0 ]; then
echo "✅ docs/readme.md is missing, but found $md_count markdown file(s) in docs/."
echo "has_simple_readme=false" >> $GITHUB_OUTPUT
else
echo "❌ docs/readme.md is missing and no other markdown files found in docs/."
exit 1
fi
else
echo "✅ docs/readme.md exists."
echo "has_simple_readme=true" >> $GITHUB_OUTPUT
fi
else
echo "❌ Folder 'docs' does not exist."
exit 1
fi
- name: Check for required sections in Documentation
if: steps.check-readme.outputs.has_simple_readme == 'true'
run: |
patterns=(
"#{1,3} Contributing"
Expand All @@ -53,12 +65,14 @@ jobs:
fi
done
- name: Check for empty sections
if: steps.check-readme.outputs.has_simple_readme == 'true'
run: |
if grep -Eq "^#+ .+\\n(?:\\n[#+|$]|[#+|$])" docs/readme.md; then
echo "Empty section found in docs/readme.md ❌ Please add content"
exit 1
fi
- name: Check for incomplete sections
if: steps.check-readme.outputs.has_simple_readme == 'true'
run: |
if grep -Eq "TODO" docs/readme.md; then
echo "Found 'TODO' in one or more paragraphs in docs/readme.md ❌ Please add proper content"
Expand All @@ -76,7 +90,7 @@ jobs:
# Download and install packages
vale sync
# Execute
vale --output=JSON docs/*.md > vale-report.json || true
find ./docs -type f -name "*.md" -print0 | xargs -0 vale --output=JSON > vale-report.json || true

- name: Upload Results
uses: actions/upload-artifact@v7
Expand Down