File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -113,14 +113,33 @@ jobs:
113
113
114
114
echo "Cherry-picking commit: $merge_commit"
115
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; }
116
+ echo "Conflict detected for $merge_commit. Resolving with incoming changes."
117
+ conflict_files=$(git diff --name-only --diff-filter=U)
118
+ echo "Conflicting files:"
119
+ echo "$conflict_files"
120
+
121
+ for file in $conflict_files; do
122
+ if [ -f "$file" ]; then
123
+ echo "Resolving conflict for $file"
124
+ git add "$file"
125
+ else
126
+ echo "File $file has been deleted. Skipping."
127
+ git rm "$file"
128
+ fi
129
+ done
130
+
131
+ echo "Conflicts resolved. Continuing cherry-pick."
132
+ git cherry-pick --continue || { echo "Cherry-pick failed, but continuing to create PR."; }
133
+ else
134
+ echo "Cherry-pick successful for commit $merge_commit."
118
135
fi
119
136
120
137
git remote set-url origin "https://${BOT_TOKEN}@github.com/${{ github.repository }}.git"
121
138
122
139
echo "Pushing branch: $cherry_pick_branch"
123
- git push origin $cherry_pick_branch --force || { echo "Push failed"; exit 1; }
140
+ if ! git push origin $cherry_pick_branch --force; then
141
+ echo "Push failed, but continuing to create PR..."
142
+ fi
124
143
125
144
new_pr_title="$pr_title [Created by @$pr_creator from #$pr_number]"
126
145
new_pr_body="$pr_body
You can’t perform that action at this time.
0 commit comments