Skip to content

Commit d78ef37

Browse files
committed
fix(pr): gate normal sync publication
1 parent be5bf0a commit d78ef37

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

scripts/pr-lib/prepare-core.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,26 @@ prepare_sync_head() {
605605
return 1
606606
fi
607607

608+
if [ "${OPENCLAW_TESTBOX:-}" != "1" ] && [ "$prep_head_sha" != "$lease_sha" ]; then
609+
local gates_cover_prep=false
610+
if [ -e .local/gates.env ] || [ -L .local/gates.env ]; then
611+
require_artifact .local/gates.env
612+
# shellcheck disable=SC1091
613+
source .local/gates.env
614+
if [ "${LAST_VERIFIED_HEAD_SHA:-}" = "$prep_head_sha" ]; then
615+
gates_cover_prep=true
616+
fi
617+
fi
618+
if [ "$gates_cover_prep" != "true" ]; then
619+
prepare_gates "$pr"
620+
checkout_prep_branch "$pr"
621+
if [ "$(git rev-parse HEAD)" != "$prep_head_sha" ]; then
622+
echo "Prepare gates changed the synced head; restart prepare-sync-head."
623+
return 1
624+
fi
625+
fi
626+
fi
627+
608628
if [ "${OPENCLAW_PR_PUSH_MODE:-graphql}" != "git" ] && ! require_graphql_push_preserves_ancestry "$lease_sha" "$prep_head_sha"; then
609629
echo "Retry prepare-sync-head with the explicit git/unsigned overrides for this content-changing head."
610630
return 1

0 commit comments

Comments
 (0)