Skip to content

Submodules Sync

Submodules Sync #697

name: 'Submodules Sync'
on:
workflow_dispatch: # on button click
schedule:
- cron: '0 * * * *' # Every 1 hour
jobs:
sync:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: 'recursive'
- name: Initialize and update submodules
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Debug Submodule Status
run: |
# Make sure the 'providers' directory exists
if [ -d "providers" ]; then
echo "providers directory exists"
cd providers
git status
else
echo "providers directory not found"
fi
- name: Add and commit files
run: |
git add --all
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update submodules at $(date "+DATE: %Y-%m-%d TIME: %H:%M:%S")"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}