8989 gh pr comment "${{ github.event.pull_request.number }}" --body \
9090 "❌ Failed to cherry-pick to \`$TARGET_BRANCH\` due to conflicts. Dispatching ClaudeBox to resolve. [View backport run]($WORKFLOW_URL)."
9191
92- - name : Notify Slack on backport failure
93- if : steps.backport.outcome == 'failure'
94- env :
95- SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
96- run : |
97- PR_NUMBER="${{ github.event.pull_request.number }}"
98- PR_TITLE="${{ github.event.pull_request.title }}"
99- PR_URL="${{ github.event.pull_request.html_url }}"
100- TARGET_BRANCH="${{ steps.extract-branch.outputs.target_branch }}"
101- WORKFLOW_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
102-
103- TEXT=$(printf '⚠️ Automatic backport failed\n• <%s|#%s %s>\n• Target: `%s`\n• <%s|View Run>' \
104- "$PR_URL" "$PR_NUMBER" "$PR_TITLE" "$TARGET_BRANCH" "$WORKFLOW_URL")
105- RESP=$(curl -sS -X POST https://slack.com/api/chat.postMessage \
106- -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
107- -H "Content-type: application/json" \
108- -d "$(jq -n --arg c "#backports" --arg t "$TEXT" '{channel:$c, text:$t}')")
109- echo "Slack response: $RESP"
110-
111- - name: Dispatch ClaudeBox to resolve conflicts
92+ - name : Notify Slack and dispatch ClaudeBox on backport failure
11293 if : steps.backport.outcome == 'failure'
11394 env :
11495 SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
@@ -117,11 +98,12 @@ jobs:
11798 PR="${{ github.event.pull_request.number }}"
11899 TITLE="${{ github.event.pull_request.title }}"
119100 URL="${{ github.event.pull_request.html_url }}"
101+ AUTHOR="${{ github.event.pull_request.user.login }}"
120102 BRANCH="${{ steps.extract-branch.outputs.target_branch }}"
121103
122- # Post to #backports, derive permalink from response
123- TEXT=$(printf '⚠️ Backport failed: <%s|#%s %s> → `%s`. Dispatching ClaudeBox…' \
124- "$URL" "$PR" "$TITLE" "$BRANCH")
104+ # Post single message to #backports, derive permalink from response
105+ TEXT=$(printf '⚠️ Backport failed: <%s|#%s %s> → `%s` (author: %s) . Dispatching ClaudeBox…' \
106+ "$URL" "$PR" "$TITLE" "$BRANCH" "$AUTHOR" )
125107 RESP=$(curl -sS -X POST https://slack.com/api/chat.postMessage \
126108 -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
127109 -H "Content-type: application/json" \
0 commit comments