Skip to content

style: fix lint errors #77

style: fix lint errors

style: fix lint errors #77

Workflow file for this run

---
name: CI
permissions:
contents: read
on:
pull_request:
branches:
- master
types:
- opened
- synchronize
- reopened
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install markdownlint-cli
run: npm install -g markdownlint-cli
- name: Lint markdown files
run: |
markdownlint \
-f \
-o markdownlint_report.log \
--ignore-path .markdownlintignore \
'**/*.md'
- name: Print summary
if: failure()
run: |
{
echo "### Linting report:"
cat markdownlint_report.log
echo "### Suggested changes:"
echo '```diff'
echo "$(git diff)"
echo '```'
} >> "${GITHUB_STEP_SUMMARY}"
- name: Additional checks
if: always()
run: |
exit_code=0
# check character count
find ./docs -type f -name '*.md' | while IFS= read -r file; do
echo "Checking $file"
char_count=$(wc -c <"$file")
echo "Character count: $char_count"
filename=$(basename "$file")
echo "Filename: $filename"
if [[ $char_count -gt 4096 ]]; then
echo "$file exceeds the 4096 character limit" >> "${GITHUB_STEP_SUMMARY}"
exit_code=1
fi
done
exit $exit_code