Skip to content

Commit 780e4bc

Browse files
committed
GH-704 - Attempt cherry-pick before creating the ticket.
1 parent 8369eec commit 780e4bc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

etc/create-backport-tickets.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,20 @@ number=$1
1313
# For each of the target versions
1414
for version in ${@:2}
1515
do
16-
echo "gh issue create --title \"$title\" --body \"Back-port of $sourceGh.\" --label \"$labels\" --assignee \"@me\" --milestone \"$version\""
17-
number=$(gh issue create --title "$title" --body "Back-port of $sourceGh." --label "$labels" --assignee "@me" --milestone "$version" | awk -F '/' '{print $NF}')
18-
echo "New ticket number: $number"
19-
2016
# Turn 1.5.6 into 1.5.x
2117
targetBranch="$(echo "$version" | grep -oE '^[0-9]+\.[0-9]+').x"
2218

2319
# Checkout target branch and cherry-pick commit
24-
2520
echo "Checking out branch $targetBranch"
2621
git checkout $targetBranch
2722

2823
echo "Cherry-pick commit from $branch"
2924
git cherry-pick $branch
3025

26+
echo "gh issue create --title \"$title\" --body \"Back-port of $sourceGh.\" --label \"$labels\" --assignee \"@me\" --milestone \"$version\""
27+
number=$(gh issue create --title "$title" --body "Back-port of $sourceGh." --label "$labels" --assignee "@me" --milestone "$version" | awk -F '/' '{print $NF}')
28+
echo "New ticket number: $number"
29+
3130
# Replace ticket reference with new one
3231
targetGh="GH-$number"
3332
expression="s/$sourceGh/$targetGh/g"

0 commit comments

Comments
 (0)