Skip to content

Create test.md

Create test.md #12

Workflow file for this run

name: run-textlint
on:
pull_request_target:
types: [opened, synchronize]
paths: ['docs/**/*.md']
jobs:
run-textlint:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npx textlint ./docs//*.md -o ./.textlint.log | true
shell: bash {0}
- name: Report if textlint finds problems
run: |
if [ -e ./.textlint.log ]; then
# create body file
pwd_esc=$(pwd | sed 's/\//\\\//g')
cat ./.textlint.log | sed "s/${pwd_esc}/### :policeman: ./g" >> ./.body.txt
# pr comment
gh pr comment --body-file ./.body.txt "${URL}"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
URL: ${{ github.event.pull_request.html_url }}