zhizhi/.github/workflows/bingshuo-neural-system.yml

60 lines
1.9 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.

# ───────────────────────────────────────────────────────
# 冰朔主控神经系统 · 自动维护 Workflow v1.0
# Bingshuo Master Neural System — Auto Maintenance
#
# 触发条件:
# 1. push 到 main 分支时关键路径变化
# 2. 每日 08:00 北京时间UTC 00:00定时巡检
# 3. 手动触发
# ───────────────────────────────────────────────────────
name: 冰朔主控神经系统 · 自动维护
on:
push:
branches: [main]
paths:
- '.github/brain/**'
- 'docs/**'
- 'persona-studio/**'
- 'backend/**'
- 'src/**'
- '.github/workflows/**'
- 'scripts/**'
schedule:
- cron: '0 0 * * *' # 每日 UTC 00:00北京时间 08:00
workflow_dispatch: # 手动触发
permissions:
contents: write
jobs:
neural-sync:
runs-on: ubuntu-latest
steps:
- name: 检出仓库
uses: actions/checkout@v4
- name: 配置 Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 运行冰朔神经系统编译
run: node scripts/bingshuo-neural-sync.js
- name: 提交更新
run: |
git config user.name "bingshuo-neural-system"
git config user.email "bingshuo-neural-system@guanghulab.com"
git add .github/brain/bingshuo-*.json .github/brain/bingshuo-*.md
if git diff --cached --quiet; then
echo "无变化,跳过提交"
else
git commit -m "🧠 冰朔主控神经系统自动编译 $(date -u +%Y-%m-%dT%H:%M:%SZ)"
git pull --rebase origin main || echo "⚠️ rebase 冲突,尝试强制推送"
git push || echo "⚠️ 推送失败(可能有并发提交),下次巡检会重试"
fi