forked from hagopjay/KeGG-KnowlEdgeGraphGrokker
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (41 loc) · 1.5 KB
/
Copy pathci.yml
File metadata and controls
46 lines (41 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for broken internal links
run: |
echo "Scanning HTML files for broken internal references..."
FAIL=0
for html in $(find . -name "*.html" -not -path "./.git/*"); do
grep -oP '(?:href|src)="([^"#:]*)"' "$html" | grep -oP '"[^"]*"' | tr -d '"' | while read -r ref; do
[ -z "$ref" ] && continue
dir=$(dirname "$html")
target="$dir/$ref"
if [ ! -f "$target" ]; then
echo "BROKEN: $html -> $ref (resolved: $target)"
FAIL=1
fi
done
done
if [ "$FAIL" -ne 0 ]; then
echo "::warning::Broken internal links detected"
else
echo "All internal links OK"
fi
- name: Verify index.html exists
run: test -f index.html && echo "index.html present" || (echo "Missing index.html" && exit 1)
- name: Report file counts
run: |
echo "Repository structure:"
echo " HTML files: $(find . -name '*.html' -not -path './.git/*' | wc -l)"
echo " MD files: $(find . -name '*.md' -not -path './.git/*' | wc -l)"
echo " Directories:"
find . -maxdepth 2 -type d -not -path './.git/*' -not -path './.git/*/*' | sort | sed 's/^/ /'