Skip to content

Submodules Sync

Submodules Sync #499

# https://stackoverflow.com/questions/64407333/using-github-actions-to-automatically-update-the-repos-submodules
name: 'Submodules Sync'
on:
workflow_dispatch:
jobs:
sync:
name: 'Submodules Sync'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
- name: Git Sumbodule Update
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Commit update
run: |
git config --global user.name 'GitHub bot'
git config --global user.email 'bot@noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Auto updated submodule" && git push || echo "No changes to commit"