Submodules Sync #656
This file contains 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: '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.MY_PAT }} | |
branch: ${{ github.ref }} | |