-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (33 loc) · 974 Bytes
/
textlint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: textlint
on:
pull_request:
types: [opened, edited, reopened, ready_for_review]
push:
workflow_dispatch:
jobs:
textlint:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Switch to pull request branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup node with cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install packages via packages.json
run: npm install
- name: Run textlint
run: |
if [ -e github.event.pull_request.html_url ]; then
gh pr comment --body "Comment from :policeman: is here `npx textlint ./README.md`" "${URL}"
else
npx textlint ./README.md
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
URL: ${{ github.event.pull_request.html_url }}