@@ -145,7 +145,10 @@ jobs:
145145 rsync -av --delete ${{ env.RSYNC_SITECORE_UPLOAD_API_SRC_EXCLUDES }} ../upload-api/src/ ./upload-api/src/
146146 rsync -av --delete ../upload-api/migration-sitecore/ ./upload-api/migration-sitecore/
147147 node remove-broken-imports.js
148-
148+ if [ -z "$(git status --porcelain)" ]; then
149+ echo "No changes to commit. Skipping push."
150+ exit 0
151+ fi
149152 git add .
150153 git commit -m "Sync changes from migration-v2 PR #${{ github.event.pull_request.number }}"
151154 git push origin sync-from-migration-v2-${{ github.event.pull_request.number }}
@@ -250,7 +253,10 @@ jobs:
250253 rsync -av --delete ${{ env.RSYNC_CONTENTFUL_UPLOAD_API_SRC_EXCLUDES }} ../upload-api/src/ ./upload-api/src/
251254 rsync -av --delete ../upload-api/migration-contentful/ ./upload-api/migration-contentful/
252255 node remove-broken-imports.js
253-
256+ if [ -z "$(git status --porcelain)" ]; then
257+ echo "No changes to commit. Skipping push."
258+ exit 0
259+ fi
254260 git add .
255261 git commit -m "Sync changes from migration-v2 PR #${{ github.event.pull_request.number }}"
256262 git push origin sync-from-migration-v2-${{ github.event.pull_request.number }}
@@ -354,7 +360,10 @@ jobs:
354360 rsync -av --delete ${{ env.RSYNC_WORDPRESS_UPLOAD_API_SRC_EXCLUDES }} ../upload-api/src/ ./upload-api/src/
355361 rsync -av --delete ../upload-api/migration-wordpress/ ./upload-api/migration-wordpress/
356362 node remove-broken-imports.js
357-
363+ if [ -z "$(git status --porcelain)" ]; then
364+ echo "No changes to commit. Skipping push."
365+ exit 0
366+ fi
358367 git add .
359368 git commit -m "Sync changes from migration-v2 PR #${{ github.event.pull_request.number }}"
360369 git push origin sync-from-migration-v2-${{ github.event.pull_request.number }}
0 commit comments