diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ebbd70d..4b54667 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,19 +20,36 @@ jobs: root = Path('.') required_paths = [ - Path('.nojekyll'), Path('index.html'), Path('404.html'), - Path('_next'), + Path('_config.yml'), + Path('_layouts/default.html'), + Path('_includes/header.html'), + Path('_includes/home-main.html'), + Path('_includes/footer.html'), + Path('assets/css/site.css'), + Path('online-passive-scanner/index.html'), + Path('online-passive-scanner/report.html'), ] missing = [str(path) for path in required_paths if not path.exists()] if missing: - print('Missing required published files:', ', '.join(missing)) + print('Missing required source files:', ', '.join(missing)) sys.exit(1) - html_files = [Path('index.html'), Path('404.html')] + if Path('.nojekyll').exists(): + print('Invalid file detected: .nojekyll disables Jekyll processing for this repository.') + sys.exit(1) + + html_files = [ + Path('index.html'), + Path('404.html'), + Path('online-passive-scanner/index.html'), + Path('online-passive-scanner/report.html'), + ] pattern = re.compile(r'(?:href|src)=["\']([^"\']+)["\']') + ignore_exact = {'link', 'link_to_plugin'} + ignore_regex = [re.compile(r'^http__.+\.html$')] missing_targets = [] for html_file in html_files: @@ -54,10 +71,16 @@ jobs: if not normalized: continue - if normalized.startswith('/'): - normalized = normalized[1:] + if normalized in ignore_exact: + continue - candidate = root / normalized + if any(regex.match(normalized) for regex in ignore_regex): + continue + + if normalized.startswith('/'): + candidate = root / normalized[1:] + else: + candidate = html_file.parent / normalized if not candidate.exists(): missing_targets.append((str(html_file), target)) diff --git a/.gitignore b/.gitignore index 4eca3dd..4ab62e4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,9 @@ _site/ .jekyll-cache/ .jekyll-metadata _next/* -!_next/.keep out/ index.txt +.nojekyll vendor/ .bundle/ .DS_Store diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/_next/.keep b/_next/.keep deleted file mode 100644 index e69de29..0000000