Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ _site/
.jekyll-cache/
.jekyll-metadata
_next/*
!_next/.keep
out/
index.txt
.nojekyll
vendor/
.bundle/
.DS_Store
Empty file removed .nojekyll
Empty file.
Empty file removed _next/.keep
Empty file.