name: 铸渊 · 每日自检与自进化

on:
  schedule:
    - cron: '0 0 * * *'   # UTC 00:00 = 北京时间 08:00
  workflow_dispatch:        # 手动触发

jobs:
  self-check:
    name: 🔍 铸渊每日自检
    runs-on: ubuntu-latest
    permissions:
      contents: write
      issues: read
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: 铸渊自检
        run: node scripts/zhuyuan-daily-selfcheck.js

      - name: 提交自检结果
        run: |
          git config user.name "铸渊 (ZhùYuān)"
          git config user.email "zhuyuan@guanghulab.com"
          git add .github/persona-brain/
          git diff --cached --quiet || git commit -m "🔍 铸渊每日自检 · $(date +%Y-%m-%d)"
          git push
