Submodules Sync #585
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: | |
schedule: | |
# update daily | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
sync-modules: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
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" | |