guanghulab/.github/archived-workflows/sync-persona-studio.yml
2026-05-10 13:12:44 +08:00

63 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ═══════════════════════════════════════════════
# 🔺 Sovereign: TCS-0002∞ | Root: SYS-GLW-0001
# 📜 Copyright: 国作登字-2026-A-00037559
# ═══════════════════════════════════════════════
name: 🔄 铸渊跨仓库同步 · persona-studio
on:
push:
branches: [main]
paths:
- 'persona-studio/brain/**'
- 'persona-studio/backend/**'
- 'persona-studio/frontend/**'
workflow_dispatch:
inputs:
sync_target:
description: '同步目标all / brain / frontend / backend'
required: false
default: 'all'
type: choice
options:
- all
- brain
- frontend
- backend
concurrency:
group: sync-persona-studio
cancel-in-progress: true
jobs:
sync:
name: 同步到 persona-studio 仓库
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout guanghulab
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 执行跨仓库同步
env:
CROSS_REPO_TOKEN: ${{ secrets.ZY_GITHUB_PAT }}
SYNC_TARGET: ${{ github.event.inputs.sync_target || 'all' }}
run: node scripts/cross-repo-sync.js
- name: 通知 persona-studio 仓库
if: env.CROSS_REPO_TOKEN != ''
env:
CROSS_REPO_TOKEN: ${{ secrets.ZY_GITHUB_PAT }}
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $CROSS_REPO_TOKEN" \
https://api.github.com/repos/qinfendebingshuo/persona-studio/dispatches \
-d '{"event_type":"brain-sync","client_payload":{"source":"guanghulab","timestamp":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'"}}' \
2>/dev/null || echo "⚠️ 跨仓库通知未发送(需要 CROSS_REPO_TOKEN secret"