Skip to content

Commit

Permalink
add logic to push only when there are changes in the submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
XuHwang committed Jan 6, 2025
1 parent 3f599df commit f9116de
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/update_submodule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ jobs:

- name: Update submodules to latest commit
run: |
git config --global user.name "$GitHub Actions Bot"
git config --global user.name "GitHub Actions Bot"
git config --global user.email "[email protected]"
git submodule update --remote --merge
git add .
git commit -m "Update submodules to latest"
git push origin main
if [[ $(git status --porcelain) ]]; then
# Check if there are changes
echo "Changes detected, committing and pushing..."
git add .
git commit -m "Update submodules to latest"
git push origin main
else
echo "No changes detected, skipping commit and push."
fi

0 comments on commit f9116de

Please sign in to comment.