-
Notifications
You must be signed in to change notification settings - Fork 49
34 lines (28 loc) · 1.11 KB
/
update_submodules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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"