-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1.08 KB
/
Copy pathci.yml
File metadata and controls
38 lines (33 loc) · 1.08 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
name: CI
on:
pull_request:
branches: [main]
jobs:
validate-plugins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get modified plugins
id: changed-plugins
run: |
plugins=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'plugins/' | \
grep -oE 'plugins/[^/]+' | sort -u || true)
echo "plugins<<EOF" >> $GITHUB_OUTPUT
echo "$plugins" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Validate modified plugins
if: steps.changed-plugins.outputs.plugins != ''
run: |
failed=0
while IFS= read -r plugin_dir; do
[ -z "$plugin_dir" ] && continue
if [ -f "${plugin_dir}/.claude-plugin/plugin.json" ]; then
echo "Validating: $plugin_dir"
if ! bash scripts/validate-plugin.sh "$plugin_dir"; then
failed=1
fi
fi
done <<< "${{ steps.changed-plugins.outputs.plugins }}"
exit $failed