Skip to content

Commit b4348b7

Browse files
Update GH action
1 parent a3f52f4 commit b4348b7

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/main/ci_internal_links.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@
1010
import subprocess
1111
import sys
1212
from pathlib import Path
13-
from typing import List
13+
from typing import Iterable, List
1414

1515
from links import LinkChecker, print_results
1616

17+
IGNORED_DIRS = ("templates", "analysis")
18+
19+
20+
def is_ignored_html_file(path: Path, ignored_dirs: Iterable[str] = IGNORED_DIRS) -> bool:
21+
"""Return True when the changed file is under an ignored directory."""
22+
ignored = set(ignored_dirs)
23+
return any(part in ignored for part in path.parts)
24+
1725

1826
def resolve_changed_html_files(diff_range: str) -> List[str]:
1927
"""Return changed HTML files from a git diff range."""
@@ -51,7 +59,7 @@ def resolve_changed_html_files(diff_range: str) -> List[str]:
5159
if not line.strip():
5260
continue
5361
candidate = (repo_root / line.strip()).resolve()
54-
if candidate.is_file():
62+
if candidate.is_file() and not is_ignored_html_file(candidate.relative_to(repo_root)):
5563
html_files.append(str(candidate))
5664
return sorted(set(html_files))
5765

0 commit comments

Comments
 (0)