Update Submodule #7841
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 Submodule | |
| on: | |
| schedule: | |
| # Run every hour | |
| - cron: "0 * * * *" | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| update-submodule: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout parent repository | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.WORKFLOW_PAT }} | |
| fetch-depth: 0 # Fetch all history for proper merging | |
| - name: Update submodule to latest | |
| run: | | |
| git submodule update --remote --recursive | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git add . | |
| # Pull with rebase before pushing to handle remote changes | |
| git pull --rebase origin master | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "Auto-update submodules" && git push) |