mirror of
https://github.com/sveltejs/ai-tools.git
synced 2026-07-03 19:19:25 +08:00
96 lines
3.0 KiB
YAML
96 lines
3.0 KiB
YAML
name: Sync Plugins
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'tools/**'
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
sync-plugins:
|
|
# prevents this action from running on forks
|
|
if: github.repository == 'sveltejs/ai-tools'
|
|
name: Sync Plugins from tools/
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
|
with:
|
|
node-version: 24
|
|
package-manager-cache: false # pnpm is not installed yet
|
|
|
|
- name: Install pnpm
|
|
shell: bash
|
|
run: |
|
|
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
|
|
echo installing pnpm version $PNPM_VER
|
|
npm i -g pnpm@$PNPM_VER
|
|
|
|
- name: Setup Node.js with pnpm cache
|
|
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
|
with:
|
|
node-version: 24
|
|
package-manager-cache: true # caches pnpm via packageManager field in package.json
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
|
|
|
|
- name: Sync plugins
|
|
run: pnpm sync-plugins
|
|
|
|
- name: Generate skills documentation
|
|
run: pnpm generate-skill-docs
|
|
|
|
- name: Generate subagent documentation
|
|
run: pnpm generate-subagent-docs
|
|
|
|
- name: Check for changes
|
|
id: git-check
|
|
run: |
|
|
git diff --exit-code \
|
|
plugins/claude/svelte/ \
|
|
plugins/cursor/svelte/ \
|
|
packages/opencode/skills/ \
|
|
packages/opencode/instructions/ \
|
|
packages/opencode/schema.json \
|
|
documentation/docs/ \
|
|
|| echo "changed=true" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create Pull Request
|
|
if: steps.git-check.outputs.changed == 'true'
|
|
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: 'chore: sync plugins from tools/'
|
|
branch: chore/sync-plugins
|
|
delete-branch: true
|
|
title: 'chore: sync plugins from tools/'
|
|
body: |
|
|
## Summary
|
|
Automatically synced all plugins from the `tools/` source of truth.
|
|
|
|
This PR was triggered by changes to `tools/**`.
|
|
|
|
## Changes
|
|
- Synced `plugins/claude/svelte/` (skills, agents with `permissionMode`)
|
|
- Synced `plugins/cursor/svelte/` (skills, agents, rules)
|
|
- Synced `packages/opencode/` (skills, instructions, schema)
|
|
- Updated documentation
|
|
|
|
## Generated by
|
|
GitHub Action: Sync Plugins
|
|
labels: |
|
|
chore
|
|
automated
|