返回 CodeWhale
marketplace-sync.yml
根目录 / .github / workflows / marketplace-sync.yml
1 name: Marketplace connection
2
3 on:
4 pull_request:
5 paths:
6 - 'crates/tui/assets/first-party-marketplace.json'
7 - 'scripts/sync-marketplace.py'
8 - '.github/workflows/marketplace-sync.yml'
9 push:
10 branches: [main]
11 paths:
12 - 'crates/tui/assets/first-party-marketplace.json'
13 - 'scripts/sync-marketplace.py'
14 - '.github/workflows/marketplace-sync.yml'
15 schedule:
16 - cron: '23 10 * * 1'
17 workflow_dispatch:
18
19 permissions:
20 contents: read
21
22 jobs:
23 catalog:
24 runs-on: ubuntu-latest
25 timeout-minutes: 10
26 steps:
27 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
28 with:
29 path: core
30 persist-credentials: false
31 - name: Select catalog revision
32 id: source
33 working-directory: core
34 env:
35 EVENT_NAME: ${{ github.event_name }}
36 run: |
37 python3 - <<'PY'
38 import json, os, re
39 snapshot = json.load(open('crates/tui/assets/first-party-marketplace.json'))
40 revision = snapshot['revision']
41 assert re.fullmatch(r'[0-9a-f]{40}', revision), 'Invalid marketplace revision'
42 if os.environ['EVENT_NAME'] in ('schedule', 'workflow_dispatch'):
43 revision = 'main'
44 with open(os.environ['GITHUB_OUTPUT'], 'a') as output:
45 output.write(f'revision={revision}\n')
46 PY
47 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
48 with:
49 repository: Hmbown/codewhale-plugin-marketplace
50 ref: ${{ steps.source.outputs.revision }}
51 path: marketplace
52 persist-credentials: false
53 - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
54 with:
55 node-version: '22'
56 package-manager-cache: false
57 - name: Check catalog and real bundle manifests
58 run: node marketplace/scripts/check-marketplace.mjs
59 - name: Check bundled catalog snapshot
60 run: python3 core/scripts/sync-marketplace.py --marketplace marketplace --check
61 - name: Check current skill and Computer Use mirrors
62 if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
63 run: |
64 node marketplace/scripts/check-marketplace.mjs --core core
65 node marketplace/scripts/check-cu-sync.mjs --core core
66 - name: Explain a drift failure
67 if: failure()
68 run: |
69 echo 'Review upstream changes using docs/PLUGIN_MARKETPLACE.md. Sync source-owned mirrors, rerun checks, regenerate the catalog, and rebuild. This workflow never installs, trusts, enables, or publishes plugins.' >> "$GITHUB_STEP_SUMMARY"
70
70 lines YAML