Skip to content

Update index.mdx

Update index.mdx #2

Workflow file for this run

# .github/workflows/grammar.yml
name: Grammar Check (PR Changes Only)
on:
pull_request:
jobs:
grammar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get changed markdown files
id: changed
uses: tj-actions/changed-files@v39
with:
files: |
**/*.md
**/*.mdx
- name: Skip if no docs changed
if: steps.changed.outputs.any_changed != 'true'
run: echo "No .md or .mdx files changed."
- name: Set up Node
if: steps.changed.outputs.any_changed == 'true'
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install MDX cleaner
if: steps.changed.outputs.any_changed == 'true'
run: |
npm install remark remark-mdx strip-markdown
mkdir -p dist
for file in ${{ steps.changed.outputs.all_changed_files }}; do
node scripts/clean-mdx.js "$file" > "dist/${file//\//_}.txt"
done
- name: Download LanguageTool CLI
if: steps.changed.outputs.any_changed == 'true'
run: |
curl -L -o lt.zip https://languagetool.org/download/LanguageTool-stable.zip
unzip lt.zip
echo "LT_PATH=$(pwd)/LanguageTool-*/languagetool-commandline.jar" >> $GITHUB_ENV
- name: Run LanguageTool with reviewdog
if: steps.changed.outputs.any_changed == 'true'
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for f in dist/*.txt; do
java -jar $LT_PATH -l en-US "$f" |
reviewdog -efm="%f: Line %l: %m" \
-name="LanguageTool" \
-reporter=github-pr-review \
-filter-mode=added \
-fail-on-error=false
done