From dd619b4b4d09f6688f9081dbf6d17b93c6c79541 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 30 Aug 2024 12:35:55 -0500 Subject: [PATCH] GODRIVER-3314 Fix handling of failed cherry-pick --- .evergreen/github_app/backport-pr.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.evergreen/github_app/backport-pr.sh b/.evergreen/github_app/backport-pr.sh index abd6fdee..4e56f592 100755 --- a/.evergreen/github_app/backport-pr.sh +++ b/.evergreen/github_app/backport-pr.sh @@ -60,7 +60,11 @@ echo "Creating the cherry-pick..." old_title=$(git --no-pager log $target_sha --pretty=%B | head -n 1) title="${old_title} [${target_branch}]" body="Cherry-pick of $target_sha to $target_branch" -if git cherry-pick -x -m1 $target_sha; then +status=0 +git cherry-pick -x -m1 $target_sha || { + status=$? +} +if [ $status == 0 ]; then # If the cherry-pick succeeds, push the branch and make a PR. echo "Creating the cherry-pick..." echo "Creating the PR..."