fix: ci - harden link checks

This commit is contained in:
tukuaiai
2026-05-04 04:12:08 +08:00
parent da52264bb3
commit b56e5364cf
5 changed files with 35 additions and 12 deletions
+6 -1
View File
@@ -141,6 +141,7 @@ def main() -> int:
try:
destination.relative_to(ROOT)
except ValueError:
missing_links.append((markdown_file.relative_to(ROOT), raw, destination))
continue
if not destination.exists():
@@ -155,7 +156,11 @@ def main() -> int:
if missing_links or missing_anchors:
print("MISSING_LINKS")
for source, raw, resolved in missing_links:
print(f"{source} -> {raw} => {resolved.relative_to(ROOT)}")
try:
display_path = resolved.relative_to(ROOT)
except ValueError:
display_path = resolved
print(f"{source} -> {raw} => {display_path}")
print("MISSING_ANCHORS")
for source, raw, destination, anchor in missing_anchors:
print(f"{source} -> {raw} => {destination}#{anchor}")