chore(deps): use local markdownlint in CI #112
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: CI | |
| permissions: {} | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| validate: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install dependencies | |
| run: npm ci --ignore-scripts | |
| - name: Lint markdown files | |
| run: | | |
| npx --no-install 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' | |
| 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 |