From 7345a81d229b0da63dece568a52183dc66d9fcd2 Mon Sep 17 00:00:00 2001 From: Ridvan Karatas Date: Thu, 20 Feb 2025 22:58:04 +0300 Subject: [PATCH] Fix: Use cherry-pick instead of merge for upstream sync --- .github/workflows/sync-upstream-frontend.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-upstream-frontend.yml b/.github/workflows/sync-upstream-frontend.yml index 6b6adf772..26a7ee723 100644 --- a/.github/workflows/sync-upstream-frontend.yml +++ b/.github/workflows/sync-upstream-frontend.yml @@ -34,9 +34,19 @@ jobs: run: | git checkout -b ${{ env.BRANCH_NAME }} develop - - name: Merge Upstream Changes into Shadow Branch + - name: Identify New Commits + id: check_commits run: | - git merge --no-ff upstream/develop -m "Merge latest upstream changes from checkmate" + NEW_COMMITS=$(git log develop..upstream/develop --pretty=format:"%H" | wc -l) + echo "New commits: $NEW_COMMITS" + if [ "$NEW_COMMITS" -eq 0 ]; then + echo "No new commits. Exiting." + exit 0 + fi + + - name: Cherry-pick New Commits + run: | + git cherry-pick develop..upstream/develop || (git cherry-pick --abort && exit 1) git push origin ${{ env.BRANCH_NAME }} - name: Create Pull Request