forked from apache/apisix
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.59 KB
/
doc-lint.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Doc Lint
on:
push:
paths:
- 'docs/**'
- '**/*.md'
pull_request:
branches: [master, 'release/**']
paths:
- 'docs/**'
- '**/*.md'
permissions:
contents: read
jobs:
markdownlint:
name: 🍇 Markdown
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v3
- name: 🚀 Use Node.js
uses: actions/setup-node@v3.4.1
with:
node-version: '12.x'
- run: npm install -g markdownlint-cli@0.25.0
- run: markdownlint '**/*.md'
- name: check category
run: |
./utils/check-category.py
- name: check Chinese doc
run: |
sudo pip3 install zhon
./utils/fix-zh-doc-segment.py > \
/tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1)
if grep "find broken newline in file: " /tmp/check.log; then
cat /tmp/check.log
echo "Newline can't appear in the middle of Chinese sentences."
echo "You need to run ./utils/fix-zh-doc-segment.py to fix them."
exit 1
fi
Chinse-Copywriting-lint:
name: Chinese Copywriting
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v3
- name: check Chinese copywriting
run: |
version=v1.5.6
wget -O- "https://github.com/huacnlee/autocorrect/releases/download/$version/autocorrect-linux-amd64.tar.gz" | tar -xzv
mv -v autocorrect /usr/local/bin/
autocorrect --version
git ls-files -- "docs/zh/latest/**.md" | xargs -t autocorrect --lint