guanghulab/.github/workflows/aoac-chain-repair.yml
2026-05-10 13:12:44 +08:00

102 lines
3.6 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.

# ═══════════════════════════════════════════════════
# AOAC-07+08 · 链路修复Agent + 监督Agent
# AGE OS Agent Chain · 异常检测+自动修复+监督判定
# 唤醒条件1每天23:30 CST检查回执时间
# 唤醒条件2手动触发workflow_dispatch
# 版权:国作登字-2026-A-00037559 · TCS-0002∞
# ═══════════════════════════════════════════════════
name: 🔧 AOAC-07+08 · 修复+监督
on:
schedule:
- cron: '30 15 * * *' # UTC 15:30 = 北京 23:30
workflow_dispatch:
inputs:
force_repair:
description: '强制执行修复'
type: boolean
default: false
permissions:
contents: write
issues: write
concurrency:
group: aoac-chain-repair
cancel-in-progress: false
jobs:
# ────────── AOAC-07 · 修复Agent ──────────
repair-agent:
name: 🔧 AOAC-07 · 链路修复
runs-on: ubuntu-latest
outputs:
repair_result: ${{ steps.repair.outputs.repair_result }}
needed_repair: ${{ steps.repair.outputs.needed_repair }}
repair_id: ${{ steps.repair.outputs.repair_id }}
steps:
- name: 📥 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🔧 执行链路修复Agent
id: repair
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZY_NOTION_TOKEN: ${{ secrets.ZY_NOTION_TOKEN }}
ZY_NOTION_RECEIPT_DB: ${{ secrets.ZY_NOTION_RECEIPT_DB }}
run: node scripts/aoac/chain-repair-agent.js
- name: 💾 提交修复报告
run: |
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan@guanghulab.com"
git add data/aoac/
if ! git diff --cached --quiet; then
git commit -m "🔧 AOAC-07 · 修复报告 · ${{ steps.repair.outputs.repair_id || 'check' }} [skip ci]"
for i in 1 2 3; do
git pull --rebase origin main && git push && break
echo "⚠️ 推送冲突,第${i}次重试..."
sleep $((i * 2))
done
fi
# ────────── AOAC-08 · 监督Agent ──────────
supervisor:
name: 👁️ AOAC-08 · 修复监督
needs: repair-agent
if: always()
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout (最新)
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 👁️ 执行监督Agent
id: supervisor
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZY_NOTION_TOKEN: ${{ secrets.ZY_NOTION_TOKEN }}
ZY_NOTION_RECEIPT_DB: ${{ secrets.ZY_NOTION_RECEIPT_DB }}
ZY_SMTP_USER: ${{ secrets.ZY_SMTP_USER }}
ZY_SMTP_PASS: ${{ secrets.ZY_SMTP_PASS }}
run: node scripts/aoac/repair-supervisor.js
- name: 💾 提交监督判定
run: |
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan@guanghulab.com"
git add data/aoac/
if ! git diff --cached --quiet; then
git commit -m "👁️ AOAC-08 · 监督判定 · ${{ steps.supervisor.outputs.verdict || 'check' }} [skip ci]"
for i in 1 2 3; do
git pull --rebase origin main && git push && break
echo "⚠️ 推送冲突,第${i}次重试..."
sleep $((i * 2))
done
fi