-
Notifications
You must be signed in to change notification settings - Fork 2
103 lines (89 loc) · 3.54 KB
/
Copy pathimport-external-skills.yml
File metadata and controls
103 lines (89 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: import-external-skills
# Manually-dispatched workflow that refreshes the federated portion of the
# catalog. It reads `.github/scripts/sources.yml`, shallow-clones each declared
# source, vendors the named skills into `skills/<name>/`, updates
# `.claude-plugin/marketplace.json`, regenerates the Cursor manifest, and
# opens a pull request with the result. Every imported skill goes through
# the same `validate` checks as in-repo skills before it lands on `main`.
#
# See the "A federated catalog" section of `README.md` for the design.
on:
workflow_dispatch:
inputs:
dry_run:
description: "Resolve sources and print planned changes without committing."
required: false
type: boolean
default: false
permissions:
contents: write
pull-requests: write
concurrency:
group: import-external-skills
cancel-in-progress: false
jobs:
import:
name: Import external skills
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Configure git for sparse-checkout
run: |
git --version
git config --global init.defaultBranch main
- name: Import skills declared in .github/scripts/sources.yml
id: import
run: |
if [ "${{ inputs.dry_run }}" = "true" ]; then
uv run .github/scripts/import_external_skills.py --dry-run
else
uv run .github/scripts/import_external_skills.py
fi
- name: Regenerate Cursor marketplace manifest
if: ${{ inputs.dry_run != true }}
run: uv run .github/scripts/generate_cursor_marketplace.py
- name: Validate skills and manifests
if: ${{ inputs.dry_run != true }}
run: ./.github/scripts/check.sh
- name: Detect changes
if: ${{ inputs.dry_run != true }}
id: changes
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "No changes to import. Skipping PR."
else
echo "changed=true" >> "$GITHUB_OUTPUT"
git status --short
fi
# Use the GitHub-maintained action to push to a dedicated branch and
# open a PR. PRs (rather than direct commits to main) keep imported
# changes reviewable and let the standard `validate` workflow gate
# them.
- name: Open pull request with imported skills
if: ${{ inputs.dry_run != true && steps.changes.outputs.changed == 'true' }}
uses: peter-evans/create-pull-request@v7
with:
branch: bot/import-external-skills
delete-branch: true
commit-message: "chore(catalog): refresh federated skills from .github/scripts/sources.yml"
title: "Refresh federated skills"
body: |
Automated import driven by `.github/scripts/sources.yml`.
See the "A federated catalog" section of `README.md` for the
design. Each vendored skill includes a `.federated.json` marker
recording the source repo, pinned ref, and resolved commit at
import time.
Triggered by @${{ github.actor }} via the `import-external-skills`
workflow ([run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})).
labels: |
catalog
automated
add-paths: |
.github/scripts/sources.yml
skills/**
.claude-plugin/**
.cursor-plugin/**