Skip to content

Commit e75016e

Browse files
add dedicated backport workflow for cherry-pick 2269a19 to all stable branches
Agent-Logs-Url: https://github.com/microsoft/react-native-windows/sessions/a8056eb8-9334-439b-824a-f47c401d37b4 Co-authored-by: vineethkuttan <66076509+vineethkuttan@users.noreply.github.com>
1 parent a8b4a96 commit e75016e

1 file changed

Lines changed: 122 additions & 0 deletions

File tree

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
name: Backport fix for null dereference in get_SelectionContainer (#16091)
3+
4+
'on':
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
backport:
13+
name: Backport to ${{ matrix.target_branch }}
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
target_branch:
19+
- 0.81-stable
20+
- 0.82-stable
21+
- 0.83-stable
22+
- 0.84-stable
23+
24+
steps:
25+
- name: Install GitHub CLI
26+
run: |
27+
sudo apt update
28+
sudo apt install -y gh
29+
30+
- name: Authenticate GitHub CLI
31+
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
32+
33+
- name: Clone repository
34+
env:
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
run: |
37+
gh auth setup-git
38+
gh repo clone "${{ github.repository }}" repo
39+
cd repo
40+
git fetch origin
41+
42+
- name: Configure Git
43+
working-directory: ./repo
44+
run: |
45+
git config user.name "React-Native-Windows Bot"
46+
git config user.email "53619745+rnbot@users.noreply.github.com"
47+
48+
- name: Create feature branch and cherry-pick
49+
working-directory: ./repo
50+
run: |
51+
COMMIT_ID="2269a198b3d64ff4ed66d16222e4038178eef1cf"
52+
TARGET_BRANCH="${{ matrix.target_branch }}"
53+
FEATURE_BRANCH="copilot/cherry-pick-2269a198b-to-${TARGET_BRANCH}"
54+
55+
echo "🌿 Creating feature branch $FEATURE_BRANCH from $TARGET_BRANCH"
56+
git checkout -b "$FEATURE_BRANCH" "origin/$TARGET_BRANCH"
57+
58+
echo "🍒 Cherry-picking commit $COMMIT_ID"
59+
if git cherry-pick -x "$COMMIT_ID"; then
60+
echo "✅ Cherry-pick successful"
61+
else
62+
echo "❌ Cherry-pick failed with conflicts"
63+
git status
64+
exit 1
65+
fi
66+
67+
echo "FEATURE_BRANCH=$FEATURE_BRANCH" >> "$GITHUB_ENV"
68+
69+
- name: Push feature branch
70+
working-directory: ./repo
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
FEATURE_BRANCH="${{ env.FEATURE_BRANCH }}"
75+
REPO_URL="https://x-access-token:${GH_TOKEN}@github.com"
76+
REPO_URL="${REPO_URL}/${{ github.repository }}.git"
77+
echo "📤 Pushing feature branch $FEATURE_BRANCH"
78+
git push "$REPO_URL" "$FEATURE_BRANCH"
79+
echo "✅ Feature branch pushed"
80+
81+
- name: Create Pull Request
82+
working-directory: ./repo
83+
env:
84+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
run: |
86+
TARGET_BRANCH="${{ matrix.target_branch }}"
87+
FEATURE_BRANCH="${{ env.FEATURE_BRANCH }}"
88+
89+
gh pr create \
90+
--repo "${{ github.repository }}" \
91+
--base "$TARGET_BRANCH" \
92+
--head "$FEATURE_BRANCH" \
93+
--title "[${TARGET_BRANCH}] fix: null dereference in get_SelectionContainer when no selection container exists (#16091)" \
94+
--body "Cherry-pick of commit \`2269a198b3d64ff4ed66d16222e4038178eef1cf\` to \`${TARGET_BRANCH}\`.
95+
96+
## Description
97+
98+
### Type of Change
99+
- Bug fix (non-breaking change which fixes an issue)
100+
101+
### Why
102+
Backports the fix for a null dereference crash in \`get_SelectionContainer\` that occurs when no selection container exists in the composition accessibility provider.
103+
104+
Original fix: https://github.com/${{ github.repository }}/commit/2269a198b3d64ff4ed66d16222e4038178eef1cf
105+
PR: https://github.com/${{ github.repository }}/pull/16091
106+
107+
### What
108+
- Adds a null check in \`CompositionDynamicAutomationProvider.cpp\` before dereferencing the selection container pointer in \`get_SelectionContainer\`
109+
- Includes the associated change file
110+
111+
## Screenshots
112+
N/A
113+
114+
## Testing
115+
Verify accessibility functionality in compositions with no selection container.
116+
117+
## Changelog
118+
Should this change be included in the release notes: yes
119+
120+
Fix null dereference in \`get_SelectionContainer\` when no selection container exists."
121+
122+
echo "✅ Pull request created targeting $TARGET_BRANCH"

0 commit comments

Comments
 (0)