-
Notifications
You must be signed in to change notification settings - Fork 129
82 lines (72 loc) · 2.43 KB
/
ci.yml
File metadata and controls
82 lines (72 loc) · 2.43 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
validate:
name: Validate skills and structure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Count skills
run: |
TOTAL=$(ls -d skills/*/ 2>/dev/null | wc -l)
echo "Total skills: $TOTAL"
ls -d skills/*/
- name: Validate skill frontmatter
run: |
ERRORS=0
for dir in skills/*/; do
SKILL_FILE="${dir}SKILL.md"
if [ ! -f "$SKILL_FILE" ]; then
echo "::error::Missing SKILL.md in $dir"
ERRORS=$((ERRORS + 1))
continue
fi
# Check frontmatter exists
if ! head -1 "$SKILL_FILE" | grep -q '^---'; then
echo "::error file=$SKILL_FILE::Missing frontmatter"
ERRORS=$((ERRORS + 1))
continue
fi
# Check required fields
FRONTMATTER=$(sed -n '1,/^---$/p' "$SKILL_FILE" | tail -n +2)
for field in name description; do
if ! echo "$FRONTMATTER" | grep -q "^${field}:"; then
echo "::error file=$SKILL_FILE::Missing required field: $field"
ERRORS=$((ERRORS + 1))
fi
done
done
if [ $ERRORS -gt 0 ]; then
echo "::error::$ERRORS validation error(s) found"
exit 1
fi
echo "All skills validated successfully"
- name: Validate agents
run: |
ERRORS=0
for file in agents/*.md; do
[ -f "$file" ] || continue
if ! head -1 "$file" | grep -q '^---'; then
echo "::error file=$file::Missing frontmatter"
ERRORS=$((ERRORS + 1))
fi
done
exit $ERRORS
- name: Check package.json
run: |
node -e "
const pkg = JSON.parse(require('fs').readFileSync('package.json', 'utf8'));
const required = ['name', 'version', 'description', 'license'];
const missing = required.filter(f => !pkg[f]);
if (missing.length) {
console.error('Missing package.json fields:', missing.join(', '));
process.exit(1);
}
console.log('package.json OK:', pkg.name, 'v' + pkg.version);
"
- name: Validate install script
run: node bin/superpowers-zh.js --help