Update Submodules #622
This file contains hidden or 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
| name: Update Submodules | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 */3 * * *' # Execute at midnight every day | |
| jobs: | |
| update_submodule: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Update submodule | |
| run: | | |
| git submodule update --init --recursive | |
| git submodule update --remote --recursive | |
| - name: Check if changes were made | |
| id: check_changes | |
| run: | | |
| if [ -z "$(git status --porcelain)" ]; then | |
| echo "No changes were made." | |
| else | |
| echo "Changes were made." | |
| git config --local user.name "github-actions[bot]" | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m 'Update submodules' | |
| git push | |
| fi |