Update Submodules #240
This file contains 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
# compare: https://stackoverflow.com/a/67059629/ | |
name: Update Submodules | |
on: # this workflow is triggered by the 'trigger_submodule' workflow in other repositories | |
workflow_dispatch: | |
jobs: | |
sync: | |
name: 'Update Submodules' | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 # https://github.com/actions/checkout/releases | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
submodules: true | |
- name: Update Submodules | |
run: | | |
git pull --recurse-submodules | |
git submodule update --remote --recursive | |
- name: Commit Update | |
run: | | |
git config --global user.name 'GitHub Actions Submodule Updater' | |
git config --global user.email '[email protected]' | |
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 in submodule to commit" |