ci(workflows): add skill sync and validation workflows

- 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
This commit is contained in:
Ben Sabic
2026-01-25 20:34:53 +11:00
parent 21f0ce7f6e
commit 8a1dcc657e
3 changed files with 160 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
name: Sync Claude Plugin
on:
push:
branches: [main]
paths:
- 'skills/**'
jobs:
sync:
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: true
- name: Sync skills to marketplace.json
run: node .github/scripts/sync-marketplace.js
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "chore: sync marketplace.json with skills directory"
file_pattern: .claude-plugin/marketplace.json

65
.github/workflows/validate-skill.yml vendored Normal file
View File

@@ -0,0 +1,65 @@
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 }}