Skip to content

Commit 4ef9803

Browse files
authored
Merge pull request #651 from contentstack/feature/workflow
Update repo-sync.yml
2 parents caa53f9 + dfdc50d commit 4ef9803

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/repo-sync.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ jobs:
164164
steps.file_changes.outputs.index == 'true'
165165
)
166166
run: |
167+
if [ -z "$(git status --porcelain)" ]; then
168+
echo "No changes to commit. Skipping PR creation."
169+
exit 0
170+
fi
167171
gh pr create --repo ${{ env.SITECORE_REPO }} \
168172
--title "Sync changes from migration-v2 PR #${{ github.event.pull_request.number }}" \
169173
--body "This PR syncs changes from migration-v2:\n${{ github.event.pull_request.html_url }}" \
@@ -272,6 +276,10 @@ jobs:
272276
steps.file_changes.outputs.index == 'true'
273277
)
274278
run: |
279+
if [ -z "$(git status --porcelain)" ]; then
280+
echo "No changes to commit. Skipping PR creation."
281+
exit 0
282+
fi
275283
gh pr create --repo ${{ env.CONTENTFUL_REPO }} \
276284
--title "Sync changes from migration-v2 PR #${{ github.event.pull_request.number }}" \
277285
--body "This PR syncs changes from migration-v2:\n${{ github.event.pull_request.html_url }}" \
@@ -379,6 +387,10 @@ jobs:
379387
steps.file_changes.outputs.index == 'true'
380388
)
381389
run: |
390+
if [ -z "$(git status --porcelain)" ]; then
391+
echo "No changes to commit. Skipping PR creation."
392+
exit 0
393+
fi
382394
gh pr create --repo ${{ env.WORDPRESS_REPO }} \
383395
--title "Sync changes from migration-v2 PR #${{ github.event.pull_request.number }}" \
384396
--body "This PR syncs changes from migration-v2:\n${{ github.event.pull_request.html_url }}" \

0 commit comments

Comments
 (0)