Update Submodules #10
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 Submodules | |
on: | |
workflow_dispatch: | |
jobs: | |
update-submodules: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository with submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set Git committer identity | |
run: | | |
git config --global user.name "colack" | |
git config --global user.email "[email protected]" | |
- name: Pull latest changes for submodules (auto resolve conflicts) | |
run: | | |
git submodule foreach 'git fetch && git merge -X theirs || true' | |
- name: Commit and push changes | |
env: | |
TOKEN: ${{ secrets.wk_token }} | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "Update submodules with merged changes" | |
# Set up authentication using your Personal Access Token (PAT) | |
git remote set-url origin https://[email protected]/WatermelonKatanaDevs/WatermelonKatana.git | |
# Push changes as your account (using your PAT for authentication) | |
git push origin HEAD | |
else | |
echo "No changes in submodules to commit." | |
fi |