Files
AI-Account-Toolkit/.github/workflows/submodule-sync.yml

33 lines
865 B
YAML

name: Submodule Sync
on:
schedule:
- cron: '0 0 * * *' # 每天凌晨运行
workflow_dispatch: # 支持手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update submodules
run: |
git submodule update --init --recursive --remote
- name: Commit and push if changed
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: sync submodules [skip ci]"
git push
fi