Fix/sync pr auto close (#560)

* fix redirect language code prefixes

* fix: don't close sync PR when original is merged

Only close sync PR when original is closed without merging.
When original is merged, leave sync PR open for independent review.
This commit is contained in:
Chenhe Gu
2025-11-28 00:25:53 +09:00
committed by GitHub
parent 3b403a762d
commit f5d84b7790

View File

@@ -74,11 +74,12 @@ jobs:
echo "Found open sync PR #${SYNC_PR_NUMBER}"
# Comment and close sync PR
# Handle sync PR based on original PR status
if [ "$PR_MERGED" = "true" ]; then
gh pr close ${SYNC_PR_NUMBER} --comment "✅ Original PR #${PR_NUMBER} was merged. You can still merge this sync PR independently if translations are ready."
# Original PR was merged - leave sync PR open for independent merging
echo " Original PR #${PR_NUMBER} was merged. Leaving sync PR #${SYNC_PR_NUMBER} open for independent review."
else
gh pr close ${SYNC_PR_NUMBER} --comment "❌ Original PR #${PR_NUMBER} was closed. If it reopens, sync will resume automatically."
# Original PR was closed without merging - close sync PR
gh pr close ${SYNC_PR_NUMBER} --comment "❌ Original PR #${PR_NUMBER} was closed without merging. Closing this sync PR. If the original PR reopens, sync will resume automatically."
echo "✅ Closed sync PR #${SYNC_PR_NUMBER}"
fi
echo "✅ Closed sync PR #${SYNC_PR_NUMBER}"