-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (26 loc) · 1.06 KB
/
check_links.yaml
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
on:
push:
pull_request:
schedule:
- cron: "0 0 12 * *"
name: check-links
jobs:
check-links:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Remove lines with false positives
run: |
sed -i 's/.*check_links.yaml.*//g' README.md
sed -i 's/.*check_spelling.yaml.*//g' README.md
# If there is a valid external link that fails,
# add it to mlc_config.json
- name: External links must be checked, do not allow '0' in the 'aliveStatusCodes' of mlc_config.json
run: if [[ $(grep --regexp "[^0-9]0[^0-9]" mlc_config.json | wc --lines) == "1" ]]; then echo "FOUND"; exit 42; fi
- name: Internal links must checked, do not allow '400' in the 'aliveStatusCodes' of mlc_config.json
run: if [[ $(grep --regexp "[^0-9]400[^0-9]" mlc_config.json | wc --lines) == "1" ]]; then echo "FOUND"; exit 42; fi
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: 'mlc_config.json'