Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .github/workflows/cherry-pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,13 @@ jobs:
git fetch origin "$TARGET_BRANCH"
git checkout -b "$NEW_BRANCH" "origin/$TARGET_BRANCH"

# Cherry pick
# Try standard cherry-pick first (for squash merges or single commits)
if git cherry-pick "$MERGE_COMMIT_SHA"; then
echo "Cherry-pick successful."
# Cherry pick without committing to control commit message
if git cherry-pick --no-commit "$MERGE_COMMIT_SHA"; then
echo "Cherry-pick applied (no commit)."
else
echo "Standard cherry-pick failed, trying with -m 1 (for merge commits)..."
echo "Standard cherry-pick failed, trying with -m 1..."
git cherry-pick --abort
if git cherry-pick -m 1 "$MERGE_COMMIT_SHA"; then
echo "Cherry-pick with -m 1 successful."
else
if ! git cherry-pick --no-commit -m 1 "$MERGE_COMMIT_SHA"; then
echo "Cherry-pick failed."
git cherry-pick --abort
post_comment "❌ Cherry-pick failed: Conflicts detected when cherry-picking to \`$TARGET_BRANCH\`. Please resolve manually."
Expand All @@ -127,6 +124,14 @@ jobs:
fi
fi

# Use PR title as commit message
NEW_COMMIT_MSG="[Cherry-Pick] $PR_TITLE (#$PR_NUMBER)"
# Preserve original author info
GIT_AUTHOR_NAME="$AUTHOR_NAME" \
GIT_AUTHOR_EMAIL="$AUTHOR_EMAIL" \
git commit -m "$NEW_COMMIT_MSG"
echo "Created commit with [Cherry-Pick] prefix"

# Push
# Construct authenticated URL for the fork
FORK_URL_AUTH="https://${BOT_USERNAME}:${GH_TOKEN}@github.com/${REPO_NAME}.git"
Expand Down
Loading