From e0fbb0e4ecb8ecb33220158ba69dac16155e1c48 Mon Sep 17 00:00:00 2001 From: Garrett Delfosse Date: Fri, 10 Apr 2026 11:21:13 -0400 Subject: [PATCH] feat: comment on original PR after cherry-pick PR is created (#24243) After the cherry-pick workflow creates a backport PR, it now comments on the original PR to notify the author with a link to the new PR. If the cherry-pick had conflicts, the comment includes a warning. ## Changes - Capture the URL output of `gh pr create` into `NEW_PR_URL` - Add `gh pr comment` on the original PR with the link - Append a conflict warning to the comment when applicable > Generated by Coder Agents --- .github/workflows/cherry-pick.yaml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cherry-pick.yaml b/.github/workflows/cherry-pick.yaml index f15683432a..a8d84e0329 100644 --- a/.github/workflows/cherry-pick.yaml +++ b/.github/workflows/cherry-pick.yaml @@ -134,10 +134,19 @@ jobs: exit 0 fi - gh pr create \ - --base "$RELEASE_BRANCH" \ - --head "$BACKPORT_BRANCH" \ - --title "$TITLE" \ - --body "$BODY" \ - --assignee "$SENDER" \ - --reviewer "$SENDER" + NEW_PR_URL=$( + gh pr create \ + --base "$RELEASE_BRANCH" \ + --head "$BACKPORT_BRANCH" \ + --title "$TITLE" \ + --body "$BODY" \ + --assignee "$SENDER" \ + --reviewer "$SENDER" + ) + + # Comment on the original PR to notify the author. + COMMENT="Cherry-pick PR created: ${NEW_PR_URL}" + if [ "$CONFLICT" = true ]; then + COMMENT="${COMMENT} (⚠️ conflicts need manual resolution)" + fi + gh pr comment "$PR_NUMBER" --body "$COMMENT"