diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index f5ac930..6c77125 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -25,15 +25,20 @@ jobs: git config --global user.email "${{ github.actor }}@users.noreply.github.com" - name: Update submodules run: | - if git commit -am"chore(git): Update submodules (automated) - - $(git submodule --quiet foreach \ - 'tag="$(git describe --tags --abbrev=0 origin/HEAD)" + git submodule sync + git submodule foreach --quiet ' + tag="$(git describe --tags --abbrev=0 origin/HEAD)" if [ "$(git describe --tags)" != "$tag" ]; then git checkout --quiet "$tag" - echo "$name" "$tag" - fi')" - then + echo "$name updated to $tag" + fi + ' + + if git diff --quiet; then + echo "No updates for submodules." + else + git add . + git commit -m "chore(git): Update submodules (automated)" git show --raw git push fi