-
Notifications
You must be signed in to change notification settings - Fork 728
42 lines (40 loc) · 1.24 KB
/
link_validation.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
33
34
35
36
37
38
39
40
41
name: validate-links
on:
push:
branches:
- v*
tags:
- v*
pull_request:
branches:
- v*
jobs:
validate:
runs-on: ubuntu-latest
env:
PYTHON_VER: 3.7
steps:
- uses: actions/checkout@v2
- name: Check Microsoft URLs do not pin localized versions
run: |
localized=$(find . -name '*.md' | xargs grep -ol "\.microsoft\.com/[[:alpha:]]\{2\}-[[:alpha:]]\{2\}/") || true
if [ -z "$localized" ]; then
echo "All Microsoft Docs links ok."
else
echo "The following files contain links to Microsoft Docs that pin a localized version:"
echo $localized
exit 1
fi
- name: Set up Python ${{ env.PYTHON_VER }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VER }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install setuptools wheel twine tox mechanical-markdown
pip3 uninstall -y mistune
pip3 install mistune~=2.0.5 --no-cache-dir
- name: Check Markdown Files
run: |
for name in `find . -name "*.md"`; do echo -e "------\n$name" ; mm.py -l $name || exit 1 ;done