Skip to content

Submodules Sync

Submodules Sync #1021

Workflow file for this run

name: 'Submodules Sync'
on:
push:
branches:
- main
schedule:
- cron: '1 18 * * *'
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
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
token: ${{ secrets.TOKEN_GITHUB }}
# Update references
- name: Git Sumbodule Update
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Commit update
run: |
git config --global user.name 'Git bot'
git config --global user.email 'bot@noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.TOKEN_GITHUB }}@github.com/${{ github.repository }}
[[ -z $(git status -s) ]] || git commit -am "$(git submodule summary -n -1)" && git push || echo "No changes to commit"