Update repo_health.yml
This commit is contained in:
20
.github/workflows/repo_health.yml
vendored
20
.github/workflows/repo_health.yml
vendored
@@ -700,16 +700,16 @@ jobs:
|
|||||||
# Docs index link integrity (docs/docs-index.md)
|
# Docs index link integrity (docs/docs-index.md)
|
||||||
if [ -f 'docs/docs-index.md' ]; then
|
if [ -f 'docs/docs-index.md' ]; then
|
||||||
missing_links="$(python3 - <<'PY'
|
missing_links="$(python3 - <<'PY'
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
idx = 'docs/docs-index.md'
|
idx = 'docs/docs-index.md'
|
||||||
base = os.getcwd()
|
base = os.getcwd()
|
||||||
|
|
||||||
bad = []
|
bad = []
|
||||||
pat = re.compile(r'\[[^\]]+\]\(([^)]+)\)')
|
pat = re.compile(r'\[[^\]]+\]\(([^)]+)\)')
|
||||||
|
|
||||||
with open(idx, 'r', encoding='utf-8') as f:
|
with open(idx, 'r', encoding='utf-8') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
for m in pat.findall(line):
|
for m in pat.findall(line):
|
||||||
link = m.strip()
|
link = m.strip()
|
||||||
@@ -727,9 +727,9 @@ with open(idx, 'r', encoding='utf-8') as f:
|
|||||||
if not os.path.exists(p):
|
if not os.path.exists(p):
|
||||||
bad.append(rel)
|
bad.append(rel)
|
||||||
|
|
||||||
print('\n'.join(sorted(set(bad))))
|
print('\n'.join(sorted(set(bad))))
|
||||||
PY
|
PY
|
||||||
)"
|
)"
|
||||||
if [ -n "${missing_links}" ]; then
|
if [ -n "${missing_links}" ]; then
|
||||||
extended_findings+=("docs/docs-index.md contains broken relative links")
|
extended_findings+=("docs/docs-index.md contains broken relative links")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user