-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.25 KB
/
ci.yml
File metadata and controls
47 lines (41 loc) · 1.25 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
lint:
name: Lint & verify
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Markdown lint
run: npx --yes markdownlint-cli2 '**/*.md' '#node_modules'
- name: Validate CITATION.cff
run: |
pip install --quiet cffconvert
cffconvert --validate
- name: Check internal links
run: |
python3 -c "
import pathlib, re, sys
errors = []
for md in pathlib.Path('.').rglob('*.md'):
text = md.read_text(encoding='utf-8', errors='replace')
for m in re.finditer(r'\[([^\]]+)\]\((?!https?://|mailto:)([^)#]+)', text):
target = md.parent / m.group(2)
if not target.exists():
errors.append(f' {md}: broken link -> {m.group(2)}')
if errors:
print('Broken internal links found:')
print('\n'.join(errors))
sys.exit(1)
print('All internal links OK')
"