Files
sveltejs-ai-tools/.github/workflows/sync-cursor-plugin.yml
2026-02-22 15:02:31 +01:00

87 lines
2.9 KiB
YAML

name: Sync Cursor Plugin
on:
push:
branches:
- main
paths:
- 'plugins/svelte/skills/**'
- 'plugins/svelte/agents/**'
- 'instructions/AGENTS.md'
permissions:
contents: write
pull-requests: write
jobs:
sync-cursor:
# prevents this action from running on forks
if: github.repository == 'sveltejs/mcp'
name: Sync Cursor Plugin from Sources of Truth
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 Cursor plugin
run: pnpm sync-cursor-plugin
- name: Check for changes
id: git-check
run: |
git diff --exit-code svelte-cursor/ || 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 Cursor plugin from sources of truth'
branch: chore/sync-cursor-plugin
delete-branch: true
title: 'chore: sync Cursor plugin from sources of truth'
body: |
## Summary
Automatically synced the Cursor plugin from sources of truth.
This PR was triggered by changes to one or more of:
- `plugins/svelte/skills/**` (skills)
- `plugins/svelte/agents/**` (agent definitions)
- `instructions/AGENTS.md` (agent instructions/rules)
## Changes
- Synced `svelte-cursor/skills/` with latest skill definitions
- Synced `svelte-cursor/agents/` with latest agent definitions (stripped Claude-specific fields)
- Synced `svelte-cursor/rules/` with latest instructions from AGENTS.md
## Generated by
GitHub Action: Sync Cursor Plugin
labels: |
chore
automated