Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

61 lines
2.0 KiB
YAML
Raw Permalink 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.

# 光湖系统 · 个人广播同步工作流
# 从总仓库 guanghulab 的 broadcasts-outbox/{DEV_ID}/ 拉取个人广播
#
# 触发条件:
# - repository_dispatch: broadcast-push
# - schedule: 每4小时偏移30分钟避免与公告同步冲突
name: 📡 同步个人广播
on:
repository_dispatch:
types: [broadcast-push]
schedule:
- cron: '30 */4 * * *'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 拉取个人广播
env:
DEV_ID: ${{ vars.DEV_ID }}
run: |
mkdir -p my-bulletin/history
curl -sf -H "Authorization: token ${{ secrets.MAIN_REPO_TOKEN }}" \
-H "Accept: application/vnd.github.v3.raw" \
"https://api.github.com/repos/qinfendebingshuo/guanghulab/contents/broadcasts-outbox/${DEV_ID}/LATEST.md" \
-o my-bulletin/LATEST-BROADCAST.md 2>/dev/null || true
- name: 归档旧广播(如有变化)
run: |
if [ -f my-bulletin/LATEST-BROADCAST.md ]; then
HASH=$(md5sum my-bulletin/LATEST-BROADCAST.md | cut -d' ' -f1)
ARCHIVE="my-bulletin/history/$(date +%Y%m%d)-${HASH:0:8}.md"
[ ! -f "$ARCHIVE" ] && cp my-bulletin/LATEST-BROADCAST.md "$ARCHIVE"
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 重新生成 README
env:
DEV_ID: ${{ vars.DEV_ID }}
DEV_NAME: ${{ vars.DEV_NAME }}
DEV_ROLE: ${{ vars.DEV_ROLE }}
PERSONA_NAME: ${{ vars.PERSONA_NAME }}
PERSONA_ID: ${{ vars.PERSONA_ID }}
run: node scripts/generate-readme.js
- name: 提交
run: |
git config user.name "铸渊 (ZhùYuān)"
git config user.email "zhuyuan@guanghulab.com"
git add .
git diff --cached --quiet || git commit -m "📡 个人广播同步 · $(date +%Y-%m-%d-%H%M)"
git push