diff --git a/.github/workflows/update-clients.yml b/.github/workflows/update-clients.yml index a02da30..6ff062b 100644 --- a/.github/workflows/update-clients.yml +++ b/.github/workflows/update-clients.yml @@ -64,13 +64,20 @@ jobs: fi git add --all - git commit -m "Commit: ${{ needs.title.outputs.title }}" -a + + if ! git diff-index --quiet --cached HEAD; then + git commit -m "Commit: ${{ needs.title.outputs.title }}" -a + else + echo "No staged changes to commit." + exit 0 + fi if [ $? -eq 0 ]; then git push --set-upstream origin ${GITHUB_SHA::8} gh pr create --fill --base develop else echo "Nothing to commit." + exit 0 fi env: GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }} @@ -118,13 +125,20 @@ jobs: fi git add --all - git commit -m "Commit: ${{ needs.title.outputs.title }}" -a + + if ! git diff-index --quiet --cached HEAD; then + git commit -m "Commit: ${{ needs.title.outputs.title }}" -a + else + echo "No staged changes to commit." + exit 0 + fi if [ $? -eq 0 ]; then git push --set-upstream origin ${GITHUB_SHA::8} gh pr create --fill --base develop else echo "Nothing to commit." + exit 0 fi env: GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }} @@ -164,13 +178,20 @@ jobs: fi git add --all - git commit -m "Commit: ${{ needs.title.outputs.title }}" -a + + if ! git diff-index --quiet --cached HEAD; then + git commit -m "Commit: ${{ needs.title.outputs.title }}" -a + else + echo "No staged changes to commit." + exit 0 + fi if [ $? -eq 0 ]; then git push --set-upstream origin ${GITHUB_SHA::8} gh pr create --fill --base develop else echo "Nothing to commit." + exit 0 fi env: GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }} @@ -215,13 +236,20 @@ jobs: fi git add --all - git commit -m "Commit: ${{ needs.title.outputs.title }}" -a + + if ! git diff-index --quiet --cached HEAD; then + git commit -m "Commit: ${{ needs.title.outputs.title }}" -a + else + echo "No staged changes to commit." + exit 0 + fi if [ $? -eq 0 ]; then git push --set-upstream origin ${GITHUB_SHA::8} gh pr create --fill --base develop else echo "Nothing to commit." + exit 0 fi env: GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }}