-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (30 loc) · 1.16 KB
/
updateSubmodules.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
35
36
# https://stackoverflow.com/questions/64407333/using-github-actions-to-automatically-update-the-repos-submodules
name: 'Submodules Sync'
on:
# Allows you to run this workflow manually from the Actions tab or through HTTP API
workflow_dispatch:
jobs:
sync:
name: 'Submodules Sync'
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v2
with:
submodules: false
# Update references
- 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 '[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 to commit"