-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (104 loc) · 3.21 KB
/
validate.yml
File metadata and controls
122 lines (104 loc) · 3.21 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Validate
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
validate-scripts:
name: Validate Shell Scripts
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check shell script syntax
run: |
echo "Checking shell script syntax..."
for script in scripts/*.sh bootstrap/*.sh; do
if [ -f "$script" ]; then
echo " Checking $script..."
bash -n "$script" || exit 1
fi
done
echo "✓ All scripts pass syntax check"
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: './scripts'
severity: warning
continue-on-error: true
validate-templates:
name: Validate CLAUDE.md Templates
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate templates
run: |
chmod +x scripts/validate-templates.sh
./scripts/validate-templates.sh
validate-agents:
name: Validate Agent Definitions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check YAML frontmatter
run: |
echo "Checking agent YAML frontmatter..."
for agent in agents/*.md; do
if [ -f "$agent" ]; then
echo " Checking $agent..."
# Check for YAML frontmatter delimiters
if ! head -1 "$agent" | grep -q "^---$"; then
echo " ERROR: Missing opening YAML delimiter"
exit 1
fi
# Check for required fields
if ! grep -q "^name:" "$agent"; then
echo " ERROR: Missing 'name' field"
exit 1
fi
if ! grep -q "^description:" "$agent"; then
echo " ERROR: Missing 'description' field"
exit 1
fi
echo " ✓ Valid"
fi
done
echo "✓ All agents have valid frontmatter"
lint-markdown:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for placeholder text
run: |
echo "Checking for placeholder text..."
if grep -rn "TODO\|PLACEHOLDER\|lorem ipsum" --include="*.md" \
--exclude-dir=templates \
--exclude="CLAUDE.md.template" .; then
echo ""
echo "WARNING: Found placeholder text in non-template files"
# Don't fail, just warn
else
echo "✓ No placeholder text found"
fi
test-scripts:
name: Run Script Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install bats
run: |
sudo apt-get update
sudo apt-get install -y bats
- name: Run tests
run: |
if [ -d "tests" ] && ls tests/*.bats 1> /dev/null 2>&1; then
bats tests/*.bats
else
echo "No bats tests found, skipping"
fi