-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (42 loc) · 1.54 KB
/
sanity-checks.yml
File metadata and controls
52 lines (42 loc) · 1.54 KB
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
name: Sanity-Checks
on:
pull_request:
branches:
- master
jobs:
lint-files:
runs-on: ubuntu-latest
steps:
- name: Setup npm
run: |
sudo apt-get update --fix-missing
sudo apt install nodejs
npm config set prefix=${HOME}/.node
echo "${HOME}/.node/bin" >> ${GITHUB_PATH}
- name: Install markdown-spellcheck and write-good
run: |
npm install markdown-spellcheck -g
npm install write-good -g
- name: Install linkstatus
run: |
python3 -m pip install linkstatus --user
echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- name: Checkout to changes
uses: actions/checkout@v2
- name: Fetch the target branch
run: |
git fetch --prune --depth=1 origin \
refs/heads/${{ github.base_ref }}:${{ github.base_ref }}
- name: Affected Files
id: diff
run: |
affected_files="$(git diff ${{ github.base_ref }} HEAD \
--name-only --diff-filter=d | tr '\n' ' ')"
echo "::set-output name=AFFECTED_FILES::${affected_files}"
- name: Check Links
if: false # TODO: enable this as linkstatus fixed
run: "linkstatus --recursive --timeout 10 --retry 5 ${{ steps.diff.outputs.AFFECTED_FILES }}"
- name: Spelling Suggestions
run: "mdspell -r -n -a --en-us ${{ steps.diff.outputs.AFFECTED_FILES }} || true"
- name: Good Writing Suggestions
run: "write-good ${{ steps.diff.outputs.AFFECTED_FILES }} || true"