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:
113113
114114 echo "Cherry-picking commit: $merge_commit"
115115 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."
118135 fi
119136
120137 git remote set-url origin "https://${BOT_TOKEN}@github.com/${{ github.repository }}.git"
121138
122139 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
124143
125144 new_pr_title="$pr_title [Created by @$pr_creator from #$pr_number]"
126145 new_pr_body="$pr_body
You can’t perform that action at this time.
0 commit comments