Skip to content

自动更新子模块 #44

自动更新子模块

自动更新子模块 #44

name: 自动更新子模块
on:
schedule:
- cron: '0 0 * * *' # 每天UTC时间0:00执行
workflow_dispatch:
jobs:
update-submodules:
runs-on: ubuntu-latest
steps:
- name: 签出仓库
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: 更新子模块
continue-on-error: true
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git pull
git submodule update --init
git submodule update --remote
git add .
if git diff --staged --quiet; then
echo "跳过更新:子模块没有变化"
else
git commit -m "自动更新子模块 [skip ci]"
git push
fi