-
Notifications
You must be signed in to change notification settings - Fork 52
66 lines (57 loc) · 1.69 KB
/
spellcheck.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
58
59
60
61
62
63
64
65
66
name: SpellCheck
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
name: Lint changed files
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Check links in all markdown files
uses: gaurav-nelson/[email protected]
with:
use-verbose-mode: 'yes'
config-file: "scripts/markdown_link_check_config.json"
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
**/*.py
spellcheck:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get install aspell aspell-en
pip install pyspelling
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
**/*.md
- name: Check spellings
run: |
sources=""
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
sources="${sources} -S $file"
done
if [ ! "$sources" ]; then
echo "No files to spellcheck"
else
pyspelling -c $GITHUB_WORKSPACE/scripts/spellcheck_conf/spellcheck.yaml --name Markdown $sources
fi
- name: In the case of misspellings
if: ${{ failure() }}
run: |
echo "Please fix the misspellings. If you are sure about some of them, "
echo "so append those to scripts/spellcheck_conf/wordlist.txt"