-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (135 loc) · 4.84 KB
/
ci.yaml
File metadata and controls
151 lines (135 loc) · 4.84 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: 🧪 CI
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions: {}
jobs:
validate-manifests:
name: Validate manifests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 📄 Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: ✅ Validate marketplace.json (Copilot)
run: |
if ! jq -e '.name and .plugins' .github/plugin/marketplace.json > /dev/null 2>&1; then
echo "::error::Invalid .github/plugin/marketplace.json"
exit 1
fi
echo "✓ .github/plugin/marketplace.json is valid"
- name: ✅ Validate marketplace.json (Claude)
run: |
if ! jq -e '.name and .plugins' .claude-plugin/marketplace.json > /dev/null 2>&1; then
echo "::error::Invalid .claude-plugin/marketplace.json"
exit 1
fi
echo "✓ .claude-plugin/marketplace.json is valid"
- name: ✅ Validate marketplace parity
run: |
if ! diff <(jq -S . .github/plugin/marketplace.json) <(jq -S . .claude-plugin/marketplace.json) > /dev/null 2>&1; then
echo "::error::Marketplace manifests are out of sync"
diff <(jq -S . .github/plugin/marketplace.json) <(jq -S . .claude-plugin/marketplace.json) || true
exit 1
fi
echo "✓ Marketplace manifests are in sync"
- name: ✅ Validate plugin.json files
run: |
failed=0
for pj in plugins/*/plugin.json; do
plugin_dir=$(dirname "$pj")
plugin_name=$(jq -r '.name' "$pj" 2>/dev/null || echo "")
if [ -z "$plugin_name" ]; then
echo "::error::$pj: missing or invalid 'name' field"
failed=1
continue
fi
if ! echo "$plugin_name" | grep -qE '^[a-z0-9-]+$'; then
echo "::error::$pj: name '$plugin_name' must be kebab-case (a-z, 0-9, hyphens)"
failed=1
continue
fi
echo "✓ $pj ($plugin_name)"
done
exit $failed
discover-skills:
name: Discover skills
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
skills: ${{ steps.list.outputs.skills }}
steps:
- name: 📄 Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 📂 List skill directories
id: list
run: |
skills=$(find plugins -mindepth 4 -maxdepth 4 -name SKILL.md -printf '%h\n' \
| sed 's|^\./||' \
| sort \
| jq -R -s -c 'split("\n") | map(select(length > 0))')
if ! jq -e 'type == "array"' >/dev/null 2>&1 <<<"$skills"; then
echo "::error::Skill discovery produced invalid output."
exit 1
fi
echo "skills=$skills" >> "$GITHUB_OUTPUT"
echo "Discovered: $skills"
validate-spec:
name: Validate spec (${{ matrix.skill }})
needs: discover-skills
if: needs.discover-skills.outputs.skills != '[]'
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
skill: ${{ fromJson(needs.discover-skills.outputs.skills) }}
steps:
- name: 📄 Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 🐍 Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: 📦 Install skills-ref
env:
AGENTSKILLS_REF: 8d8fcbc69e0c42e05922c2ffc287a3bbdef7b0a3
run: |
python -m pip install --disable-pip-version-check \
"skills-ref @ git+https://github.com/agentskills/agentskills.git@${AGENTSKILLS_REF}#subdirectory=skills-ref"
- name: ✅ Validate ${{ matrix.skill }} against agentskills.io spec
env:
SKILL: ${{ matrix.skill }}
run: skills-ref validate "$SKILL"
ci-required-checks:
name: CI - Required Checks
runs-on: ubuntu-latest
permissions:
checks: read
statuses: read
pull-requests: read
timeout-minutes: 5
needs: [validate-manifests, discover-skills, validate-spec]
if: ${{ always() }}
steps:
- uses: devantler-tech/actions/require-checks-in-pr@1f66c91d45d374ceac9fe830a783444ebc9be958 # v3.2.0
with:
job-results: >-
${{ needs.validate-manifests.result }}
${{ needs.discover-skills.result }}
${{ needs.validate-spec.result }}