Update Submodules #305
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
# This workflow updated the submodules in the brightway2-data repository. | |
# it has been adapted from https://stackoverflow.com/a/67059629/ | |
name: Update Submodules | |
on: # this workflow is triggered by the 'trigger_submodule_update_main' workflow in eg. brightway2-data. | |
workflow_dispatch: | |
jobs: | |
sync: | |
name: 'Update Submodules' | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 # 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" |