Daily Submodule Update #178
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: Daily Submodule Update | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update-submodules: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout with Submodules | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "GitHub Actions Bot" | |
| git config user.email "github-actions@example.com" | |
| - name: Update Submodules | |
| run: | | |
| git submodule update --remote --merge --recursive | |
| git add . | |
| - name: Commit Changes | |
| id: commit | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git commit -m "chore: auto-update submodules [skip ci]" | |
| echo "has_commit=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Pass" | |
| fi | |
| - name: Push Changes | |
| if: steps.commit.outputs.has_commit == 'true' | |
| run: git push origin HEAD:${{ github.ref }} |