File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Validate Artifacts
12
3+ on :
4+ push :
5+ branches : [main]
6+ paths :
7+ - ' **.md'
8+ - ' .github/**'
9+ - ' .gitignore'
10+ pull_request :
11+ branches : [main]
12+ workflow_dispatch :
13+
14+ jobs :
15+ validate :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
20+ - name : Check required artifacts exist
21+ run : |
22+ required_files=(
23+ "README.md"
24+ "CHANGELOG.md"
25+ )
26+ missing=0
27+ for f in "${required_files[@]}"; do
28+ if [ ! -f "$f" ]; then
29+ echo "MISSING: $f"
30+ missing=$((missing + 1))
31+ else
32+ echo "OK: $f"
33+ fi
34+ done
35+ if [ $missing -gt 0 ]; then
36+ echo ""
37+ echo "$missing required artifact(s) missing."
38+ exit 1
39+ fi
40+
41+ - name : Check for placeholder content
42+ run : |
43+ placeholder_count=0
44+ for f in *.md; do
45+ if grep -qE '\[TODO\]|\[TBD\]|\[PLACEHOLDER\]|\[INSERT\]' "$f" 2>/dev/null; then
46+ echo "PLACEHOLDER CONTENT in $f:"
47+ grep -nE '\[TODO\]|\[TBD\]|\[PLACEHOLDER\]|\[INSERT\]' "$f"
48+ placeholder_count=$((placeholder_count + 1))
49+ fi
50+ done
51+ if [ $placeholder_count -gt 0 ]; then
52+ echo ""
53+ echo "Found placeholder content in $placeholder_count file(s)."
54+ exit 1
55+ fi
56+ echo "No placeholder content found."
57+
58+ - name : Validate internal links
59+ run : |
60+ broken=0
61+ for f in *.md; do
62+ while IFS= read -r link; do
63+ target=$(echo "$link" | sed 's/.*](//' | sed 's/).*//')
64+ if [[ "$target" != http* ]] && [[ "$target" != "#"* ]] && [ ! -e "$target" ]; then
65+ echo "BROKEN LINK in $f: $target"
66+ broken=$((broken + 1))
67+ fi
68+ done < <(grep -oE '\[.*?\]\([^)]+\)' "$f" 2>/dev/null || true)
69+ done
70+ if [ $broken -gt 0 ]; then
71+ echo ""
72+ echo "$broken broken internal link(s) found."
73+ exit 1
74+ fi
75+ echo "All internal links valid."
You can’t perform that action at this time.
0 commit comments