afv-library/.github/workflows/sync-template-skills.yml
k-j-kim 7b81e39631
feat: pin template deps to latest npm versions and flatten skill folders
- Add pin-template-deps.js to resolve "*" deps to exact npm versions
- Integrate pinning into sync-template-skills npm script
- Remove check-template-skills-versions.js (no longer needed)
- Simplify workflow to single sync step
- Flatten skill output: one folder per skill with cleaned names

Made-with: Cursor
2026-03-17 17:40:14 -07:00

50 lines
1.9 KiB
YAML

# Syncs skills from template npm packages into skills/salesforce-webapp-* (flat, one folder per skill).
# Discovers packages by scanning devDependencies for @salesforce/webapp-template-*
# and @salesforce/webapps-features-experimental. Creates a PR only when sync produces changes.
#
# Same steps as running locally: npm install && npm run sync-template-skills.
# Uses IDEE_GH_TOKEN (bot) for checkout and PR creation.
name: Sync template skills from npm
on:
workflow_dispatch:
schedule:
# Nightly at 03:00 UTC (after React samples at 02:00)
- cron: "0 3 * * *"
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.IDEE_GH_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: npm
# ── Pin + install + sync (all handled by the npm script) ────
- name: Sync template skills
run: npm run sync-template-skills
# ── PR creation ──────────────────────────────────────────────
- name: Create PR when there are changes
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.IDEE_GH_TOKEN }}
branch: chore/sync-template-skills
base: main
title: "chore: sync template skills from npm"
body: |
Synced skills from template npm packages into `skills/salesforce-webapp-*/`.
Same flow as running locally: `npm install` then `npm run sync-template-skills`.
commit-message: "chore: sync template skills from npm"
committer: svc-idee-bot <svc_idee_bot@salesforce.com>
author: svc-idee-bot <svc_idee_bot@salesforce.com>