This repository has been archived by the owner on Sep 9, 2023. It is now read-only.
Submodules Sync #28
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
--- | |
# 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" |