Update Submodule #7
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: Update Submodule | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
update-submodule: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Configure Git User | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
- name: Update Submodule | |
run: | | |
git submodule update --remote --merge submodules/dotfiles | |
if [[ -n "$(git status --porcelain)" ]]; then | |
git add submodules/dotfiles | |
git commit -m "CI: Update submodule to latest commit" | |
git push | |
else | |
echo "No changes to commit" | |
fi | |