zhizhi/.github/workflows/update-repo-map.yml

38 lines
1016 B
YAML

name: 铸渊 · 图书馆目录自动更新
on:
push:
branches: [main]
schedule:
- cron: '0 0 * * *' # UTC 00:00 = 北京时间 08:00 每日更新
workflow_dispatch: # 手动触发
jobs:
update-repo-map:
name: 📚 更新图书馆目录
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 安装依赖
run: npm ci
- name: 生成 repo-map.json + repo-snapshot.md
run: node scripts/generate-repo-map.js
- name: 提交图书馆目录更新
run: |
git config user.name "铸渊 (ZhùYuān)"
git config user.email "zhuyuan@guanghulab.com"
git add .github/brain/repo-map.json .github/brain/repo-snapshot.md
git diff --cached --quiet || git commit -m "📚 铸渊图书馆目录更新 · $(date +%Y-%m-%dT%H:%M)"
git push