Skip to content

Commit 1f251a3

Browse files
committed
Fix sync script
Change-Id: I7a1fb8d2deebbc3ae12bd60629a0510d7159641f Co-developed-by: Cursor <noreply@cursor.com>
1 parent 623b382 commit 1f251a3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/scripts/sync-upstream-with-rebase.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@ create_pr() {
206206
upstream_desc="commit $(git rev-parse --short "$UPSTREAM_COMMIT") (from ${UPSTREAM_REMOTE}/${UPSTREAM_BRANCH})"
207207
fi
208208
title="chore: sync ${upstream_desc} into ${BASE_BRANCH}"
209-
body=$(
210-
cat <<EOF
209+
local body_file
210+
body_file=$(mktemp)
211+
trap "rm -f '$body_file'" EXIT
212+
cat <<EOF >"$body_file"
211213
## Summary
212214
- Merge upstream \`${upstream_desc}\` into \`${BASE_BRANCH}\`
213215
- Preserve upstream commit history for incremental future syncs
@@ -217,14 +219,13 @@ create_pr() {
217219
- This PR can be merged into \`${BASE_BRANCH}\` without conflicts (conflicts were resolved during the upstream merge)
218220
- Use **merge commit** (not squash) to preserve upstream commit granularity
219221
EOF
220-
)
221222

222223
if gh pr view "$SYNC_BRANCH" >/dev/null 2>&1; then
223224
echo "PR for branch $SYNC_BRANCH already exists, skipping creation."
224225
return
225226
fi
226227

227-
gh pr create --base "$BASE_BRANCH" --head "$SYNC_BRANCH" --title "$title" --body "$body"
228+
gh pr create --base "$BASE_BRANCH" --head "$SYNC_BRANCH" --title "$title" --body-file "$body_file"
228229
}
229230

230231
# ── Main ──────────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)