Skip to content

Update Submodule

Update Submodule #6598

Workflow file for this run

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)