Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Submodules Sync

Submodules Sync #28

---
# inspired by https://stackoverflow.com/questions/64407333/using-github-actions-to-automatically-update-the-repos-submodules
name: 'Submodules Sync'
"on":
workflow_dispatch:
schedule:
- cron: "* 10 1 * *" # every monday at 10 o clock
jobs:
sync:
name: 'Submodules Sync'
runs-on: ubuntu-latest
steps:
- name: Checkout with submodule
uses: actions/checkout@v3
with:
submodules: true
- name: Git Sumbodule Update
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Commit update
run: |
git config --global user.name 'Submodule sync 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 references" && git push || echo "No changes to commit"