Skip to content

Commit

Permalink
ci: fix PR checkout (take 4)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Aug 15, 2024
1 parent 4179148 commit a8c759b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions scripts/checkout-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ set -x
git remote add pr $PR_REPO_URL
git fetch pr "$PR_HEAD_REF"

# Fetch the base commit
BASE_COMMIT=$(git merge-base HEAD "pr/$PR_HEAD_REF")
git fetch origin $BASE_COMMIT

# Import changes from the PR into the current branch without committing
git cherry-pick -n $BASE_COMMIT.."$PR_HEAD_REF" -X theirs
BASE_COMMIT=$(git merge-base HEAD "pr/$PR_HEAD_REF")
git cherry-pick -n "$BASE_COMMIT..pr/$PR_HEAD_REF" -X theirs

# List the affected files for debugging purposes
git diff --name-status --staged

0 comments on commit a8c759b

Please sign in to comment.