Skip to content

Submodules Sync

Submodules Sync #199

name: 'Submodules Sync'
on:
schedule:
# update daily
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
sync-modules:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Sync Submodules
run: | # get github action bot email following https://github.com/orgs/community/discussions/26560#discussioncomment-3252340
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git submodule sync
git submodule update --remote
git add .
- name: Commit and Push if changed
run: | # get from https://stackoverflow.com/a/67059629/8529009
git commit -am "πŸ” Sync Submodules" && git push || echo "No changes to commit, skip the push"