11
11
milestone_name :
12
12
description : " Milestone name to collect closed PRs from"
13
13
required : true
14
- default : " v3.8.3 "
14
+ default : " v3.8.4 "
15
15
target_branch :
16
16
description : " Target branch to merge the consolidated PR"
17
17
required : true
18
- default : " pre-release-v3.8.3 "
18
+ default : " pre-release-v3.8.4 "
19
19
20
20
env :
21
- MILESTONE_NAME : ${{ github.event.inputs.milestone_name || 'v3.8.3 ' }}
22
- TARGET_BRANCH : ${{ github.event.inputs.target_branch || 'pre-release-v3.8.3 ' }}
21
+ MILESTONE_NAME : ${{ github.event.inputs.milestone_name || 'v3.8.4 ' }}
22
+ TARGET_BRANCH : ${{ github.event.inputs.target_branch || 'pre-release-v3.8.4 ' }}
23
23
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24
24
BOT_TOKEN : ${{ secrets.BOT_TOKEN }}
25
25
LABEL_NAME : cherry-picked
26
- TEMP_DIR : /tmp # Using /tmp as the temporary directory
26
+ TEMP_DIR : /tmp
27
27
28
28
jobs :
29
29
merge_milestone_prs :
@@ -99,19 +99,32 @@ jobs:
99
99
merge_commit=$(echo "$pr_details" | jq -r '.merge_commit_sha')
100
100
short_commit_hash=$(echo "$merge_commit" | cut -c 1-7)
101
101
102
- if [ "$merge_commit" != "null" ];then
102
+ if [ "$merge_commit" != "null" ]; then
103
103
git fetch origin
104
+
105
+ echo "Checking out target branch: $TARGET_BRANCH"
104
106
git checkout $TARGET_BRANCH
107
+
108
+ echo "Pulling latest changes from target branch: $TARGET_BRANCH"
105
109
git pull origin $TARGET_BRANCH
110
+
106
111
cherry_pick_branch="cherry-pick-${short_commit_hash}"
107
112
git checkout -b $cherry_pick_branch
108
- git cherry-pick "$merge_commit" --strategy=recursive -X theirs || git cherry-pick --continue
113
+
114
+ echo "Cherry-picking commit: $merge_commit"
115
+ if ! git cherry-pick "$merge_commit" --strategy=recursive -X theirs; then
116
+ echo "Cherry-pick encountered conflicts, attempting to continue..."
117
+ git cherry-pick --continue || { echo "Cherry-pick failed"; exit 1; }
118
+ fi
119
+
109
120
git remote set-url origin "https://${BOT_TOKEN}@github.com/${{ github.repository }}.git"
110
- git push origin $cherry_pick_branch --force
121
+
122
+ echo "Pushing branch: $cherry_pick_branch"
123
+ git push origin $cherry_pick_branch --force || { echo "Push failed"; exit 1; }
111
124
112
125
new_pr_title="$pr_title [Created by @$pr_creator from #$pr_number]"
113
126
new_pr_body="$pr_body
114
- >This PR is created from original PR #$pr_number."
127
+ > This PR is created from original PR #$pr_number."
115
128
116
129
response=$(curl -s -X POST -H "Authorization: token $BOT_TOKEN" \
117
130
-H "Accept: application/vnd.github+json" \
@@ -130,4 +143,4 @@ jobs:
130
143
-d '{"labels": ["milestone-merge"]}' \
131
144
"https://api.github.com/repos/${{ github.repository }}/issues/$new_pr_number/labels"
132
145
fi
133
- done
146
+ done
0 commit comments