Update Git Submodule #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |