Skip to content

Update Git Submodule #9

Update Git Submodule

Update Git Submodule #9

Workflow file for this run

name: Update Git Submodule
on:
schedule:
- cron: '0 2 * * 1' # 每周一 UTC 时间 2 点执行
workflow_dispatch: # 手动触发
permissions:
contents: write
jobs:
update-submodule:
runs-on: ubuntu-latest
steps:
- name: Checkout repository (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update submodules to latest
run: |
git submodule update --init --recursive --remote
- name: Commit submodule updates
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: update submodules to latest" || echo "No changes to commit"
- name: Push changes
run: |
git push