Skip to content

Update Submodules

Update Submodules #31

name: Update Submodules
on:
schedule:
- cron: '0 */8 * * *' # Runs every 68hours
workflow_dispatch:
jobs:
update-submodules:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive # Initialize and fetch all submodules
- name: Update submodules to latest commit
run: |
git submodule update --remote
- name: Check for changes
id: changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changes=true" >> $GITHUB_ENV
else
echo "changes=false" >> $GITHUB_ENV
fi
- name: Commit and push changes
if: env.changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Updated submodules"
git push origin main