- Add sync-claude-plugin workflow to auto-update marketplace.json when skills change - Add validate-skill workflow to validate SKILL.md files on push/PR - Add sync-marketplace.js script for skill discovery and count updates
65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
name: Validate Agent Skill
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "**/SKILL.md"
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "**/SKILL.md"
|
|
|
|
concurrency:
|
|
group: validate-skill-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
detect-changes:
|
|
runs-on: ubuntu-slim
|
|
if: github.event.pull_request.draft != true && github.actor != 'dependabot[bot]'
|
|
outputs:
|
|
skills: ${{ steps.changed-skills.outputs.skills }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get changed skills
|
|
id: changed-skills
|
|
run: |
|
|
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
|
BASE=${{ github.event.pull_request.base.sha }}
|
|
HEAD=${{ github.event.pull_request.head.sha }}
|
|
else
|
|
BASE=${{ github.event.before }}
|
|
HEAD=${{ github.event.after }}
|
|
fi
|
|
|
|
# Find changed SKILL.md files and extract skill directories
|
|
SKILLS=$(git diff --name-only $BASE $HEAD | \
|
|
grep 'SKILL.md$' | \
|
|
xargs -I {} dirname {} | \
|
|
sort -u | \
|
|
jq -R -s -c 'split("\n") | map(select(length > 0))')
|
|
|
|
echo "skills=$SKILLS" >> $GITHUB_OUTPUT
|
|
echo "Changed skills: $SKILLS"
|
|
|
|
validate:
|
|
needs: detect-changes
|
|
if: needs.detect-changes.outputs.skills != '[]'
|
|
runs-on: ubuntu-slim
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
skill: ${{ fromJson(needs.detect-changes.outputs.skills) }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Validate ${{ matrix.skill }}
|
|
uses: Flash-Brew-Digital/validate-skill@v1
|
|
with:
|
|
path: ${{ matrix.skill }} |