From de6a19bb55fdd052a7c52d37c1b5d13c091f7d73 Mon Sep 17 00:00:00 2001 From: goodov <5928869+goodov@users.noreply.github.com> Date: Thu, 25 Jul 2024 22:38:01 +0700 Subject: [PATCH] Fetch full repository to run a rebase. (#24838) --- .github/workflows/sync-and-rebase-pr-from-fork.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-and-rebase-pr-from-fork.yml b/.github/workflows/sync-and-rebase-pr-from-fork.yml index dd3738d025a..1a82b1fd699 100644 --- a/.github/workflows/sync-and-rebase-pr-from-fork.yml +++ b/.github/workflows/sync-and-rebase-pr-from-fork.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 + with: + fetch-depth: 0 - name: Setup Git run: | @@ -44,9 +46,9 @@ jobs: git fetch --no-tags contributor +"$headRefName":"$contribHeadRefName" # Rebase the branch with the latest targeting branch HEAD - git fetch origin "$baseRefName" git checkout "$contribHeadRefName" - if ! git rebase origin/"$baseRefName"; then + git fetch origin "$baseRefName" + if ! git rebase FETCH_HEAD; then echo "Rebase conflict detected. Please resolve the conflicts and push the changes to your fork. Exiting!" exit 1 fi